Skip to main content

Rig

Finds the joints of an R15 character built with Roblox's Avatar Joint Upgrade (the AnimationConstraint and BallSocketConstraint pairs that replaced Motor6D) and switches them between three modes without ever adding or replacing a joint:

  • Kinematic: IsKinematic = true, the stock behaviour. Animations drive the parts exactly.
  • Muscle: the upper body (waist, neck, arms) is simulated with a soft AngularStrength so it lags and swings with the body, while the root and legs stay kinematic so the Humanoid keeps the character on its feet. This is the staggering look.
  • Limp: every joint is simulated with almost no strength, the ball sockets provide the limits, and the character is a ragdoll.

Everything a mode touches is snapshotted first so Rig.restore puts it all back.

Only the server calls into this (joint properties replicate from the server, and the network owner simulates them). Rigs still on Motor6D are reported as unsupported: Rig.get returns nil and Stagger warns once, because the whole point is to use the joints Roblox already gave the character.

Properties​

UPPER_JOINTS​

This item is read only and cannot be modified. Read Only
Rig.UPPER_JOINTS: {string}

Joint names simulated in Muscle mode: Waist, Neck, both shoulders, elbows and wrists.

LOWER_JOINTS​

This item is read only and cannot be modified. Read Only
Rig.LOWER_JOINTS: {string}

Joint names kept kinematic in Muscle mode: Root, both hips, knees and ankles.

Functions​

isSupported​

Rig.isSupported(character: Instance) → boolean

Returns whether character is an R15 rig on AnimationConstraints (the Avatar Joint Upgrade).

get​

Rig.get(character: Model) → Rig?

Collects the joints of character. Returns nil when the character is not a supported rig (see Rig.isSupported).

apply​

Rig.apply(
rig: Rig,
mode: Mode,
strength: number,--

AngularStrength for the simulated joints in this mode (ignored for Kinematic).

damping: number--

AngularDamping for the simulated joints in this mode (ignored for Kinematic).

) → ()

Puts the rig in mode. Takes the snapshot on the first call. The strength and damping come from the Config (MuscleStrength / MuscleDamping or LimpStrength / LimpDamping).

setOwner​

Rig.setOwner(
rig: Rig,
owner: Player?
) → ()

Gives owner (a player, or nil for the server) network ownership of every unanchored part of the rig, so the peer driving the stagger is the one simulating the body. Used for NPCs; ownership of a player's character is left to Roblox.

releaseOwner​

Rig.releaseOwner(rig: Rig) → ()

Hands ownership of the rig back to Roblox's automatic assignment once the stagger is over.

restore​

Rig.restore(rig: Rig) → ()

Restores every joint, ball socket, collision flag and AutoRotate the snapshot recorded, and forgets the snapshot. WalkSpeed and the Humanoid state flags are owner-side and are handled by the Controller. Does nothing if no mode was ever applied.

Show raw api
{
    "functions": [
        {
            "name": "isSupported",
            "desc": "Returns whether `character` is an R15 rig on AnimationConstraints (the Avatar Joint Upgrade).",
            "params": [
                {
                    "name": "character",
                    "desc": "",
                    "lua_type": "Instance"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 90,
                "path": "packages/src/Stagger/Rig.luau"
            }
        },
        {
            "name": "get",
            "desc": "Collects the joints of `character`. Returns `nil` when the character is not a supported rig\n(see [Rig.isSupported]).",
            "params": [
                {
                    "name": "character",
                    "desc": "",
                    "lua_type": "Model"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Rig?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 108,
                "path": "packages/src/Stagger/Rig.luau"
            }
        },
        {
            "name": "apply",
            "desc": "Puts the rig in `mode`. Takes the snapshot on the first call. The strength and damping\ncome from the [Config] (`MuscleStrength` / `MuscleDamping` or `LimpStrength` / `LimpDamping`).",
            "params": [
                {
                    "name": "rig",
                    "desc": "",
                    "lua_type": "Rig"
                },
                {
                    "name": "mode",
                    "desc": "",
                    "lua_type": "Mode"
                },
                {
                    "name": "strength",
                    "desc": "`AngularStrength` for the simulated joints in this mode (ignored for Kinematic).",
                    "lua_type": "number"
                },
                {
                    "name": "damping",
                    "desc": "`AngularDamping` for the simulated joints in this mode (ignored for Kinematic).",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 234,
                "path": "packages/src/Stagger/Rig.luau"
            }
        },
        {
            "name": "setOwner",
            "desc": "Gives `owner` (a player, or `nil` for the server) network ownership of every unanchored part\nof the rig, so the peer driving the stagger is the one simulating the body. Used for NPCs;\nownership of a player's character is left to Roblox.",
            "params": [
                {
                    "name": "rig",
                    "desc": "",
                    "lua_type": "Rig"
                },
                {
                    "name": "owner",
                    "desc": "",
                    "lua_type": "Player?"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 293,
                "path": "packages/src/Stagger/Rig.luau"
            }
        },
        {
            "name": "releaseOwner",
            "desc": "Hands ownership of the rig back to Roblox's automatic assignment once the stagger is over.",
            "params": [
                {
                    "name": "rig",
                    "desc": "",
                    "lua_type": "Rig"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 308,
                "path": "packages/src/Stagger/Rig.luau"
            }
        },
        {
            "name": "restore",
            "desc": "Restores every joint, ball socket, collision flag and `AutoRotate` the snapshot recorded,\nand forgets the snapshot. `WalkSpeed` and the Humanoid state flags are owner-side and are\nhandled by the [Controller]. Does nothing if no mode was ever applied.",
            "params": [
                {
                    "name": "rig",
                    "desc": "",
                    "lua_type": "Rig"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 325,
                "path": "packages/src/Stagger/Rig.luau"
            }
        }
    ],
    "properties": [
        {
            "name": "UPPER_JOINTS",
            "desc": "Joint names simulated in Muscle mode: `Waist`, `Neck`, both shoulders, elbows and wrists.",
            "lua_type": "{ string }",
            "readonly": true,
            "source": {
                "line": 65,
                "path": "packages/src/Stagger/Rig.luau"
            }
        },
        {
            "name": "LOWER_JOINTS",
            "desc": "Joint names kept kinematic in Muscle mode: `Root`, both hips, knees and ankles.",
            "lua_type": "{ string }",
            "readonly": true,
            "source": {
                "line": 77,
                "path": "packages/src/Stagger/Rig.luau"
            }
        }
    ],
    "types": [],
    "name": "Rig",
    "desc": "Finds the joints of an R15 character built with Roblox's Avatar Joint Upgrade (the\n`AnimationConstraint` and `BallSocketConstraint` pairs that replaced `Motor6D`) and\nswitches them between three modes without ever adding or replacing a joint:\n\n- **Kinematic**: `IsKinematic = true`, the stock behaviour. Animations drive the parts exactly.\n- **Muscle**: the upper body (waist, neck, arms) is simulated with a soft `AngularStrength`\n  so it lags and swings with the body, while the root and legs stay kinematic so the\n  `Humanoid` keeps the character on its feet. This is the staggering look.\n- **Limp**: every joint is simulated with almost no strength, the ball sockets provide the\n  limits, and the character is a ragdoll.\n\nEverything a mode touches is snapshotted first so [Rig.restore] puts it all back.\n\nOnly the server calls into this (joint properties replicate from the server, and the network\nowner simulates them). Rigs still on `Motor6D` are reported as unsupported: `Rig.get` returns\n`nil` and `Stagger` warns once, because the whole point is to use the joints Roblox already\ngave the character.",
    "source": {
        "line": 22,
        "path": "packages/src/Stagger/Rig.luau"
    }
}