Skip to main content

Rjac

Rjac is an object used to rotate the character body parts according to camera direction.

Properties

CameraCFrame

Rjac.CameraCFrame: CFrame

The last known Camera CFrame of the Player.

Character

Rjac.Character: Model

A Model controlled by the Player that contains a Humanoid, body parts, scripts and other objects.

Connections

Rjac.Connections: table

Table that stores the connections used by Rjac.

Enabled

Rjac.Enabled: bool

Determines whether body parts will be rotated.

JointConfigurations

Rjac.JointConfigurations: table

Joint configurations for rotating, joint offsets, multipliers, rotation axes.

Player

Rjac.Player: Player

Player/owner of the Rjac object.

Functions

new

Rjac.new(
RjacInfotable--

Table of stuff to overwrite default Rjac stuff with

) → ()

Creates a new Rjac Object.

AddBodyJoint

Rjac:AddBodyJoint(
BodyPartstring,--

Name of the body part.

BodyJointstring,--

Name of the body joint.

MultiplierVectorVector3,--

Vector by which the rotation angle will be multiplied.

LookVectorAxestable--

CameraCFrame.LookVector axes which will be used to rotate the joint axes

) → ()

Add body joint to the list of joints which are to be rotated.

Destroy

Rjac:Destroy() → ()

Disconnects all connections, sets the joint offsets back to defauly, deletes everything.

error

Rjac:error(
arg1any,
arg2any,
arg3any,
arg4any
) → ()

A wrapper function for the default error, adds some stuff at the start

Initiate

Rjac:Initiate() → ()

Creates and stores the connection to listen for Player.CharacterAdded event

OnCharacterAdded

Rjac:OnCharacterAdded(
Charactermodel--

The Player Character

) → ()

Function to be run when the Player gets a new Character. Waits for the avatar to be fully loaded, then calls :ResetJointOffsets(Character).

print

Rjac:print(
arg1any,
arg2any,
arg3any,
arg4any
) → ()

A wrapper function for the default print, adds some stuff at the start

RemoveBodyJoint

Rjac:RemoveBodyJoint(
BodyPartstring,--

Name of the body part.

BodyJointstring--

Name of the body joint.

) → ()

Remove a specific body joint from the Rjac.JointConfigurations

ResetJointOffsets

Rjac:ResetJointOffsets(
CharacterModel--

The target Character to read from

) → ()

Reads and stores the Motor6D.C0 into JointConfigurations[].JointOffset. Not meant to be used every single time.

Update

Rjac:Update(
CameraCFrameCFrame--

The Player's Camera.CFrame

) → ()

Updates the CameraCFrame and then rotates the body joints accordingly

UpdateBodyJointMultiplierVector

Rjac:UpdateBodyJointMultiplierVector(
BodyPartstring,--

Name of the body part.

BodyJointstring,--

Name of the body joint.

MultiplierVectorVector3--

Vector by which the rotation angle will be multiplied.

) → ()

Update body joint multiplier vector for a specific joint.

UpdateBodyJointOffset

Rjac:UpdateBodyJointOffset(
BodyPartstring,--

Name of the body part.

BodyJointstring,--

Name of the body joint.

JointOffsetCFrame--

CFrame by which the rotations are offset.

) → ()

Update body joint offset for a specific joint.

warn

Rjac:warn(
arg1any,
arg2any,
arg3any,
arg4any
) → ()

A wrapper function for the default warn, adds some stuff at the start

Show raw api
{
    "functions": [
        {
            "name": "AddBodyJoint",
            "desc": "Add body joint to the list of joints which are to be rotated.",
            "params": [
                {
                    "name": "BodyPart",
                    "desc": "Name of the body part.",
                    "lua_type": "string"
                },
                {
                    "name": "BodyJoint",
                    "desc": "Name of the body joint.",
                    "lua_type": "string"
                },
                {
                    "name": "MultiplierVector",
                    "desc": "Vector by which the rotation angle will be multiplied.",
                    "lua_type": "Vector3"
                },
                {
                    "name": "LookVectorAxes",
                    "desc": "CameraCFrame.LookVector axes which will be used to rotate the joint axes",
                    "lua_type": "table"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 62,
                "path": "src/ReplicatedStorage/Rjac2.lua"
            }
        },
        {
            "name": "Destroy",
            "desc": "Disconnects all connections, sets the joint offsets back to defauly, deletes everything.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 90,
                "path": "src/ReplicatedStorage/Rjac2.lua"
            }
        },
        {
            "name": "error",
            "desc": "A wrapper function for the default `error`, adds some stuff at the start",
            "params": [
                {
                    "name": "arg1",
                    "desc": "",
                    "lua_type": "any"
                },
                {
                    "name": "arg2",
                    "desc": "",
                    "lua_type": "any"
                },
                {
                    "name": "arg3",
                    "desc": "",
                    "lua_type": "any"
                },
                {
                    "name": "arg4",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 113,
                "path": "src/ReplicatedStorage/Rjac2.lua"
            }
        },
        {
            "name": "Initiate",
            "desc": "Creates and stores the connection to listen for `Player.CharacterAdded` event",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 120,
                "path": "src/ReplicatedStorage/Rjac2.lua"
            }
        },
        {
            "name": "OnCharacterAdded",
            "desc": "Function to be run when the Player gets a new Character. Waits for the avatar to be fully loaded, then calls `:ResetJointOffsets(Character)`.",
            "params": [
                {
                    "name": "Character",
                    "desc": "The Player Character",
                    "lua_type": "model"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 132,
                "path": "src/ReplicatedStorage/Rjac2.lua"
            }
        },
        {
            "name": "print",
            "desc": "A wrapper function for the default `print`, adds some stuff at the start",
            "params": [
                {
                    "name": "arg1",
                    "desc": "",
                    "lua_type": "any"
                },
                {
                    "name": "arg2",
                    "desc": "",
                    "lua_type": "any"
                },
                {
                    "name": "arg3",
                    "desc": "",
                    "lua_type": "any"
                },
                {
                    "name": "arg4",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 179,
                "path": "src/ReplicatedStorage/Rjac2.lua"
            }
        },
        {
            "name": "RemoveBodyJoint",
            "desc": "Remove a specific body joint from the `Rjac.JointConfigurations`",
            "params": [
                {
                    "name": "BodyPart",
                    "desc": "Name of the body part.",
                    "lua_type": "string"
                },
                {
                    "name": "BodyJoint",
                    "desc": "Name of the body joint.",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 189,
                "path": "src/ReplicatedStorage/Rjac2.lua"
            }
        },
        {
            "name": "ResetJointOffsets",
            "desc": "Reads and stores the `Motor6D.C0` into `JointConfigurations[].JointOffset`. Not meant to be used every single time.",
            "params": [
                {
                    "name": "Character",
                    "desc": "The target Character to read from",
                    "lua_type": "Model"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 214,
                "path": "src/ReplicatedStorage/Rjac2.lua"
            }
        },
        {
            "name": "Update",
            "desc": "Updates the CameraCFrame and then rotates the body joints accordingly",
            "params": [
                {
                    "name": "CameraCFrame",
                    "desc": "The Player's Camera.CFrame",
                    "lua_type": "CFrame"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 232,
                "path": "src/ReplicatedStorage/Rjac2.lua"
            }
        },
        {
            "name": "UpdateBodyJointMultiplierVector",
            "desc": "Update body joint multiplier vector for a specific joint.",
            "params": [
                {
                    "name": "BodyPart",
                    "desc": "Name of the body part.",
                    "lua_type": "string"
                },
                {
                    "name": "BodyJoint",
                    "desc": "Name of the body joint.",
                    "lua_type": "string"
                },
                {
                    "name": "MultiplierVector",
                    "desc": "Vector by which the rotation angle will be multiplied.",
                    "lua_type": "Vector3"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 278,
                "path": "src/ReplicatedStorage/Rjac2.lua"
            }
        },
        {
            "name": "UpdateBodyJointOffset",
            "desc": "Update body joint offset for a specific joint.",
            "params": [
                {
                    "name": "BodyPart",
                    "desc": "Name of the body part.",
                    "lua_type": "string"
                },
                {
                    "name": "BodyJoint",
                    "desc": "Name of the body joint.",
                    "lua_type": "string"
                },
                {
                    "name": "JointOffset",
                    "desc": "CFrame by which the rotations are offset.",
                    "lua_type": "CFrame"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 294,
                "path": "src/ReplicatedStorage/Rjac2.lua"
            }
        },
        {
            "name": "warn",
            "desc": "A wrapper function for the default `warn`, adds some stuff at the start",
            "params": [
                {
                    "name": "arg1",
                    "desc": "",
                    "lua_type": "any"
                },
                {
                    "name": "arg2",
                    "desc": "",
                    "lua_type": "any"
                },
                {
                    "name": "arg3",
                    "desc": "",
                    "lua_type": "any"
                },
                {
                    "name": "arg4",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 311,
                "path": "src/ReplicatedStorage/Rjac2.lua"
            }
        },
        {
            "name": "new",
            "desc": "Creates a new `Rjac` Object.",
            "params": [
                {
                    "name": "RjacInfo",
                    "desc": "Table of stuff to overwrite default Rjac stuff with",
                    "lua_type": "table"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 320,
                "path": "src/ReplicatedStorage/Rjac2.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "CameraCFrame",
            "desc": "The last known Camera CFrame of the Player.",
            "lua_type": "CFrame",
            "source": {
                "line": 17,
                "path": "src/ReplicatedStorage/Rjac2.lua"
            }
        },
        {
            "name": "Character",
            "desc": "A Model controlled by the Player that contains a Humanoid, body parts, scripts and other objects.",
            "lua_type": "Model",
            "source": {
                "line": 24,
                "path": "src/ReplicatedStorage/Rjac2.lua"
            }
        },
        {
            "name": "Connections",
            "desc": "Table that stores the connections used by Rjac.",
            "lua_type": "table",
            "source": {
                "line": 31,
                "path": "src/ReplicatedStorage/Rjac2.lua"
            }
        },
        {
            "name": "Enabled",
            "desc": "Determines whether body parts will be rotated.",
            "lua_type": "bool",
            "source": {
                "line": 38,
                "path": "src/ReplicatedStorage/Rjac2.lua"
            }
        },
        {
            "name": "JointConfigurations",
            "desc": "Joint configurations for rotating, joint offsets, multipliers, rotation axes.",
            "lua_type": "table",
            "source": {
                "line": 45,
                "path": "src/ReplicatedStorage/Rjac2.lua"
            }
        },
        {
            "name": "Player",
            "desc": "Player/owner of the Rjac object.",
            "lua_type": "Player",
            "source": {
                "line": 52,
                "path": "src/ReplicatedStorage/Rjac2.lua"
            }
        }
    ],
    "types": [],
    "name": "Rjac",
    "desc": "Rjac is an object used to rotate the character body parts according to camera direction.",
    "source": {
        "line": 10,
        "path": "src/ReplicatedStorage/Rjac2.lua"
    }
}