Skip to main content

TrackTypes

The registry of track types: Instance, Camera, GlobalAudio, Rig, Empty, Subsequence, Fade, Folder, and TimeDilation. A track type decides what subject its track drives, which phase it evaluates in, and how it finds or creates a subject when none is bound.

Types​

TrackTypeDefinition​

interface TrackTypeDefinition {
Name: string
DisplayName: string
Description: string
SubjectClass: string?--

Accepted subject classes, separated by |

DefaultPhase: "Heartbeat" | "Render"--

Camera tracks use Render

AllowsSpawnable: boolean--

Whether the subject may be a template cloned on playback

AcquiresCamera: boolean?--

Requests CameraOwnership while any section is active

EvaluatesEveryPhase: boolean?--

Runs its sections in both phases, for sections that drive a child sequence

IsFolder: boolean?--

Nests other tracks in the editor and gates them with its Enabled toggle; holds no sections

SectionTypes: {string}?--

The section types the track accepts; nil accepts any whose subject fits, {} accepts none

ScalesTime: boolean?--

Its sections scale the sequence clock rather than write to a subject

SubjectIsRoot: boolean?--

Its subject is the root its sections' sequences play under; unbound, they keep their own

Icon: string?--

The editor's icon: a class name drawn with Studio's class icon, or an image asset id. Nil shows the subject's class icon

Parameters: {[string]: ParameterDeclaration}
InferSubject: ((
track: TrackData,
sequence: SequenceData
) → Instance?)?--

Finds a subject when none is bound

CreateSubject: ((
track: TrackData,
sequence: SequenceData,
root: Instance?
) → Instance?)?--

Builds a subject for the playback

ResolveSectionSubject: ((
subject: Instance,
section: SectionData
) → Instance?)?--

Hands a section a different instance, such as a rig's Animator

}

Functions​

Register​

TrackTypes.Register(definition: TrackTypeDefinition) → ()

Registers a track type, replacing any with the same name.

Get​

TrackTypes.Get(name: string) → TrackTypeDefinition?

GetNames​

TrackTypes.GetNames() → {string}

Names in registration order.

GetAll​

TrackTypes.GetAll() → {[string]: TrackTypeDefinition}

Returns the registry itself; do not modify it.

GetPhase​

TrackTypes.GetPhase(track: TrackData) → Types.Phase

Returns the phase a track evaluates in: its own EvaluateOnRenderStep override if set, otherwise its type's default.

Show raw api
{
    "functions": [
        {
            "name": "Register",
            "desc": "Registers a track type, replacing any with the same name.",
            "params": [
                {
                    "name": "definition",
                    "desc": "",
                    "lua_type": "TrackTypeDefinition"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 181,
                "path": "runtime/TrackTypes.luau"
            }
        },
        {
            "name": "Get",
            "desc": "",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "TrackTypeDefinition?\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 191,
                "path": "runtime/TrackTypes.luau"
            }
        },
        {
            "name": "GetNames",
            "desc": "Names in registration order.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ string }\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 199,
                "path": "runtime/TrackTypes.luau"
            }
        },
        {
            "name": "GetAll",
            "desc": "Returns the registry itself; do not modify it.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ [string]: TrackTypeDefinition }\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 207,
                "path": "runtime/TrackTypes.luau"
            }
        },
        {
            "name": "GetPhase",
            "desc": "Returns the phase a track evaluates in: its own `EvaluateOnRenderStep` override if set, otherwise its\ntype's default.",
            "params": [
                {
                    "name": "track",
                    "desc": "",
                    "lua_type": "TrackData"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Types.Phase\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 216,
                "path": "runtime/TrackTypes.luau"
            }
        }
    ],
    "properties": [],
    "types": [
        {
            "name": "TrackTypeDefinition",
            "desc": "",
            "fields": [
                {
                    "name": "Name",
                    "lua_type": "string",
                    "desc": ""
                },
                {
                    "name": "DisplayName",
                    "lua_type": "string",
                    "desc": ""
                },
                {
                    "name": "Description",
                    "lua_type": "string",
                    "desc": ""
                },
                {
                    "name": "SubjectClass",
                    "lua_type": "string?",
                    "desc": "Accepted subject classes, separated by `|`"
                },
                {
                    "name": "DefaultPhase",
                    "lua_type": "\"Heartbeat\" | \"Render\"",
                    "desc": "Camera tracks use Render"
                },
                {
                    "name": "AllowsSpawnable",
                    "lua_type": "boolean",
                    "desc": "Whether the subject may be a template cloned on playback"
                },
                {
                    "name": "AcquiresCamera",
                    "lua_type": "boolean?",
                    "desc": "Requests [CameraOwnership] while any section is active"
                },
                {
                    "name": "EvaluatesEveryPhase",
                    "lua_type": "boolean?",
                    "desc": "Runs its sections in both phases, for sections that drive a child sequence"
                },
                {
                    "name": "IsFolder",
                    "lua_type": "boolean?",
                    "desc": "Nests other tracks in the editor and gates them with its Enabled toggle; holds no sections"
                },
                {
                    "name": "SectionTypes",
                    "lua_type": "{ string }?",
                    "desc": "The section types the track accepts; nil accepts any whose subject fits, `{}` accepts none"
                },
                {
                    "name": "ScalesTime",
                    "lua_type": "boolean?",
                    "desc": "Its sections scale the sequence clock rather than write to a subject"
                },
                {
                    "name": "SubjectIsRoot",
                    "lua_type": "boolean?",
                    "desc": "Its subject is the root its sections' sequences play under; unbound, they keep their own"
                },
                {
                    "name": "Icon",
                    "lua_type": "string?",
                    "desc": "The editor's icon: a class name drawn with Studio's class icon, or an image asset id. Nil shows the subject's class icon"
                },
                {
                    "name": "Parameters",
                    "lua_type": "{ [string]: ParameterDeclaration }",
                    "desc": ""
                },
                {
                    "name": "InferSubject",
                    "lua_type": "((track: TrackData, sequence: SequenceData) -> Instance?)?",
                    "desc": "Finds a subject when none is bound"
                },
                {
                    "name": "CreateSubject",
                    "lua_type": "((track: TrackData, sequence: SequenceData, root: Instance?) -> Instance?)?",
                    "desc": "Builds a subject for the playback"
                },
                {
                    "name": "ResolveSectionSubject",
                    "lua_type": "((subject: Instance, section: SectionData) -> Instance?)?",
                    "desc": "Hands a section a different instance, such as a rig's Animator"
                }
            ],
            "source": {
                "line": 62,
                "path": "runtime/TrackTypes.luau"
            }
        }
    ],
    "name": "TrackTypes",
    "desc": "The registry of track types: Instance, Camera, GlobalAudio, Rig, Empty, Subsequence, Fade, Folder, and\nTimeDilation. A track type decides what subject its track drives, which phase it evaluates in, and how it\nfinds or creates a subject when none is bound.",
    "source": {
        "line": 40,
        "path": "runtime/TrackTypes.luau"
    }
}