Skip to main content

WeldConstraintUtils

Utility functions to create WeldConstraint objects in Roblox.

Functions

namedBetween

WeldConstraintUtils.namedBetween(
namestring,
part0BasePart,
part1BasePart,
parentInstance?--

Optional

) → Weld | WeldConstraint

Creates a new weld constraint between the given parts.

info

Actually generally defaults to a weld because the weld constraint system is buggy. https://devforum.roblox.com/t/weld-constraint-behaves-differently-on-server-compared-to-client/445036

info

We tend to create a weld constraint between parts and terrain, because terrain will remove welds when it deforms for non-touching parts.

https://devforum.roblox.com/t/allow-way-to-prevent-terrain-after-deforming-from-removing-welds/631061

namedBetweenForceWeldConstraint

WeldConstraintUtils.namedBetweenForceWeldConstraint(
namestring,
part0BasePart,
part1BasePart,
parentInstance?--

Optional

) → WeldConstraint

Creates a new weld constraint between the given parts guaranteed.

info

This may not always work in ways you want, because Roblox is complicated. When in doubt, it is recommend you use WeldConstraintUtils.namedBetween for all welding scenarios.

Show raw api
{
    "functions": [
        {
            "name": "namedBetween",
            "desc": "Creates a new weld constraint between the given parts.\n\n:::info\nActually generally defaults to a weld because the weld constraint system is buggy.\nhttps://devforum.roblox.com/t/weld-constraint-behaves-differently-on-server-compared-to-client/445036\n:::\n\n:::info\nWe tend to create a weld constraint between parts and terrain, because terrain will remove welds when it\ndeforms for non-touching parts.\n\nhttps://devforum.roblox.com/t/allow-way-to-prevent-terrain-after-deforming-from-removing-welds/631061\n:::",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "part0",
                    "desc": "",
                    "lua_type": "BasePart"
                },
                {
                    "name": "part1",
                    "desc": "",
                    "lua_type": "BasePart"
                },
                {
                    "name": "parent",
                    "desc": "Optional",
                    "lua_type": "Instance?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Weld | WeldConstraint"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 29,
                "path": "src/weldconstraintutils/src/Shared/WeldConstraintUtils.lua"
            }
        },
        {
            "name": "namedBetweenForceWeldConstraint",
            "desc": "Creates a new weld constraint between the given parts guaranteed.\n\n:::info\nThis may not always work in ways you want, because Roblox is complicated. When in doubt, it is\nrecommend you use [WeldConstraintUtils.namedBetween] for all welding scenarios.\n:::",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "part0",
                    "desc": "",
                    "lua_type": "BasePart"
                },
                {
                    "name": "part1",
                    "desc": "",
                    "lua_type": "BasePart"
                },
                {
                    "name": "parent",
                    "desc": "Optional",
                    "lua_type": "Instance?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "WeldConstraint"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 68,
                "path": "src/weldconstraintutils/src/Shared/WeldConstraintUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "WeldConstraintUtils",
    "desc": "Utility functions to create WeldConstraint objects in Roblox.",
    "source": {
        "line": 5,
        "path": "src/weldconstraintutils/src/Shared/WeldConstraintUtils.lua"
    }
}