Skip to main content

GetCFrameFromInstance

Converts an Instance to a CFrame

Functions

getCFrameFromInstance

GetCFrameFromInstance.getCFrameFromInstance(instanceInstance) → Result<CFrame,string>

Converts an Instance to a CFrame

Valid Instances:

Instance Conversion Method
CFrameValue Uses .Value
Vector3Value Converts .Value to a CFrame
BasePart Use .CFrame
Attachment Uses .WorldCFrame
Model Uses :GetPivot()

An Instance can also be linked from an ObjectValue, but the depth is limited to 1

Show raw api
{
    "functions": [
        {
            "name": "getCFrameFromInstance",
            "desc": "Converts an Instance to a CFrame\n#### Valid Instances:\nInstance | Conversion Method\n--- | ---\nCFrameValue | Uses .Value\nVector3Value | Converts .Value to a CFrame\nBasePart | Use .CFrame\nAttachment | Uses .WorldCFrame\nModel | Uses :GetPivot()\nAn Instance can also be linked from an ObjectValue, but the depth is limited to 1",
            "params": [
                {
                    "name": "instance",
                    "desc": "",
                    "lua_type": "Instance"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Result<CFrame, string>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 25,
                "path": "src/shared/util/getCFrameFromInstance.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "GetCFrameFromInstance",
    "desc": "Converts an Instance to a CFrame",
    "source": {
        "line": 7,
        "path": "src/shared/util/getCFrameFromInstance.lua"
    }
}