Skip to main content

CFramedModel

Extends AnimationModel

A Model moved via :GetPivot() Optionally, a Base can be added to offset this Model from the updated position. The Base is usually used like a parent-child offset update where the position of the parent updates the position of the children. It allows it to work with separate AnimationModels

Children

{
	ModelType: StringValue, // set to Model
	Base: ObjectValue<BaseInstance> | PVInstance | CFrameInstance | nil,
}

Properties

cframe

CFramedModel.cframe: CFrame

base

CFramedModel.base: PVInstance?

baseCFrame

CFramedModel.baseCFrame: CFrame?

Functions

new

Constructor
CFramedModel.new(modelModel) → CFramedModel

Constructor It's recommended that you use .create()

getDataFromInstance

CFramedModel.getDataFromInstance(modelModel) → Result<CFramedModelData,string>

Extracts data from an Instance

create

CFramedModel.create(modelModel) → Result

Creates a CFramedModel with the given Instance. Returns a Result.

Destroy

Deconstructor
CFramedModel:Destroy() → ()

Deconstructor

setBase

CFramedModel:setBase(basePVInstance) → ()

Sets the base

setCFrame

CFramedModel:setCFrame(cframeCFrame) → ()

Sets Model at the given CFrame

setInDefaultPosition

CFramedModel:setInDefaultPosition() → ()

Sets in default position

update

CFramedModel:update(
positionnumber,
modelDirectionDirection,
currentTrackCFrameTrack
) → nil

updateModel

CFramedModel:updateModel() → ()

Updates the model from the current offset

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructor\nIt's recommended that you use .create()",
            "params": [
                {
                    "name": "model",
                    "desc": "",
                    "lua_type": "Model"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "CFramedModel"
                }
            ],
            "function_type": "static",
            "tags": [
                "Constructor"
            ],
            "source": {
                "line": 47,
                "path": "src/shared/animationModel/CFramedModel.lua"
            }
        },
        {
            "name": "getDataFromInstance",
            "desc": "Extracts data from an Instance",
            "params": [
                {
                    "name": "model",
                    "desc": "",
                    "lua_type": "Model"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Result<CFramedModelData, string>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 68,
                "path": "src/shared/animationModel/CFramedModel.lua"
            }
        },
        {
            "name": "create",
            "desc": "Creates a CFramedModel with the given Instance.\nReturns a Result.",
            "params": [
                {
                    "name": "model",
                    "desc": "",
                    "lua_type": "Model"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Result"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 103,
                "path": "src/shared/animationModel/CFramedModel.lua"
            }
        },
        {
            "name": "_setData",
            "desc": "Sets the data of this CFramedModel",
            "params": [
                {
                    "name": "data",
                    "desc": "",
                    "lua_type": "CFramedModelData"
                }
            ],
            "returns": [],
            "function_type": "method",
            "private": true,
            "source": {
                "line": 128,
                "path": "src/shared/animationModel/CFramedModel.lua"
            }
        },
        {
            "name": "Destroy",
            "desc": "Deconstructor",
            "params": [],
            "returns": [],
            "function_type": "method",
            "tags": [
                "Deconstructor"
            ],
            "source": {
                "line": 134,
                "path": "src/shared/animationModel/CFramedModel.lua"
            }
        },
        {
            "name": "setBase",
            "desc": "Sets the base",
            "params": [
                {
                    "name": "base",
                    "desc": "",
                    "lua_type": "PVInstance"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 142,
                "path": "src/shared/animationModel/CFramedModel.lua"
            }
        },
        {
            "name": "setCFrame",
            "desc": "Sets Model at the given CFrame",
            "params": [
                {
                    "name": "cframe",
                    "desc": "",
                    "lua_type": "CFrame"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 164,
                "path": "src/shared/animationModel/CFramedModel.lua"
            }
        },
        {
            "name": "setInDefaultPosition",
            "desc": "Sets in default position",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 169,
                "path": "src/shared/animationModel/CFramedModel.lua"
            }
        },
        {
            "name": "update",
            "desc": "",
            "params": [
                {
                    "name": "position",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "modelDirection",
                    "desc": "",
                    "lua_type": "Direction"
                },
                {
                    "name": "currentTrack",
                    "desc": "",
                    "lua_type": "CFrameTrack"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "nil"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 179,
                "path": "src/shared/animationModel/CFramedModel.lua"
            }
        },
        {
            "name": "updateModel",
            "desc": "Updates the model from the current offset",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 197,
                "path": "src/shared/animationModel/CFramedModel.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "cframe",
            "desc": "",
            "lua_type": "CFrame",
            "source": {
                "line": 31,
                "path": "src/shared/animationModel/CFramedModel.lua"
            }
        },
        {
            "name": "base",
            "desc": "",
            "lua_type": "PVInstance?",
            "source": {
                "line": 34,
                "path": "src/shared/animationModel/CFramedModel.lua"
            }
        },
        {
            "name": "baseCFrame",
            "desc": "",
            "lua_type": "CFrame?",
            "source": {
                "line": 37,
                "path": "src/shared/animationModel/CFramedModel.lua"
            }
        }
    ],
    "types": [],
    "name": "CFramedModel",
    "desc": "##### Extends [AnimationModel](/api/AnimationModel)\nA Model moved via :GetPivot()\nOptionally, a Base can be added to offset this Model from the updated position.\nThe Base is usually used like a parent-child offset update where the position of the parent updates\nthe position of the children. It allows it to work with separate AnimationModels\n### Children\n```ts\n{\n\tModelType: StringValue, // set to Model\n\tBase: ObjectValue<BaseInstance> | PVInstance | CFrameInstance | nil,\n}",
    "source": {
        "line": 28,
        "path": "src/shared/animationModel/CFramedModel.lua"
    }
}