Skip to main content

Animator

Animators are responsible for playing animations on the Luanoid primarily through the CharacterController. Luanoids can accept different Animators by setting the Animator property on them.

Animations loaded on the server before the Client Luanoid is created will automatically be replicated.

See Custom Animators for writing your own Animator.

Properties

Luanoid

This item is read only and cannot be modified. Read Only
Animator.Luanoid: Luanoid

Reference to the Luanoid this CharacterController is attached to.

AnimationController

This item is read only and cannot be modified. Read Only
Animator.AnimationController: AnimationController

Reference to the AnimationController used internally.

Animator

This item is read only and cannot be modified. Read Only
Animator.Animator: Animator

Reference to the Animator used internally.

AnimationTracks

This item is read only and cannot be modified. Read Only
Animator.AnimationTracks: {[string]: AnimationTrack}

References to the loaded AnimationTracks.

AnimationPlayed

This item is read only and cannot be modified. Read Only
Animator.AnimationPlayed: Signal<(animationTrack: AnimationTrack)>

Fires after PlayAnimation() is executed.

AnimationStopped

This item is read only and cannot be modified. Read Only
Animator.AnimationStopped: Signal<(animationTrack: AnimationTrack)>

Fires after StopAnimation() is executed.

AnimationLoaded

This item is read only and cannot be modified. Read Only
Animator.AnimationLoaded: Signal<(animationTrack: AnimationTrack)>

Fires after LoadAnimation() is executed.

AnimationUnloading

This item is read only and cannot be modified. Read Only
Animator.AnimationUnloading: Signal<(animationTrack: AnimationTrack)>

Fires while UnloadAnimation() is executing.

Functions

LoadAnimation

Animator:LoadAnimation(
name: string,
animation: Animation
) → AnimationTrack

Loads an animation into the Animator under a name that can be used to play it later.

PlayAnimation

Animator:PlayAnimation(
name: string,
...: any
) → ()

Plays an animation loaded previously. Remaining arguments are passed to AnimationTrack:Play().

StopAnimation

Animator:StopAnimation(
name: string,
...: any
) → ()

Stops a playing AnimationTrack. Remaining arguments are passed to AnimationTrack:Stop().

StopAnimations

Animator:StopAnimations(...: any) → ()

Stops all currently playing AnimationTracks. Arguments are passed to AnimationTrack:Stop().

UnloadAnimation

Animator:UnloadAnimation(name: string) → ()

Unloads an animation from the Animator.

UnloadAnimations

Animator:UnloadAnimations() → ()

Unloads all animations from the Animator.

Show raw api
{
    "functions": [
        {
            "name": "_loadAnimation",
            "desc": "",
            "params": [
                {
                    "name": "animation",
                    "desc": "",
                    "lua_type": "Animation"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "AnimationTrack"
                }
            ],
            "function_type": "method",
            "private": true,
            "source": {
                "line": 112,
                "path": "src/Animator.lua"
            }
        },
        {
            "name": "LoadAnimation",
            "desc": "Loads an animation into the Animator under a name that can be used to play\nit later.",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "animation",
                    "desc": "",
                    "lua_type": "Animation"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "AnimationTrack"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 129,
                "path": "src/Animator.lua"
            }
        },
        {
            "name": "PlayAnimation",
            "desc": "Plays an animation loaded previously. Remaining arguments are passed to\n`AnimationTrack:Play()`.",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 157,
                "path": "src/Animator.lua"
            }
        },
        {
            "name": "StopAnimation",
            "desc": "Stops a playing AnimationTrack. Remaining arguments are passed to\n`AnimationTrack:Stop()`.",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 178,
                "path": "src/Animator.lua"
            }
        },
        {
            "name": "StopAnimations",
            "desc": "Stops all currently playing AnimationTracks. Arguments are passed to\n`AnimationTrack:Stop()`.",
            "params": [
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 198,
                "path": "src/Animator.lua"
            }
        },
        {
            "name": "UnloadAnimation",
            "desc": "Unloads an animation from the Animator.",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 211,
                "path": "src/Animator.lua"
            }
        },
        {
            "name": "UnloadAnimations",
            "desc": "Unloads all animations from the Animator.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 235,
                "path": "src/Animator.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "Luanoid",
            "desc": "Reference to the Luanoid this CharacterController is attached to.\n    ",
            "lua_type": "Luanoid",
            "readonly": true,
            "source": {
                "line": 29,
                "path": "src/Animator.lua"
            }
        },
        {
            "name": "AnimationController",
            "desc": "Reference to the AnimationController used internally.\n    ",
            "lua_type": "AnimationController",
            "readonly": true,
            "source": {
                "line": 35,
                "path": "src/Animator.lua"
            }
        },
        {
            "name": "Animator",
            "desc": "Reference to the Animator used internally.\n    ",
            "lua_type": "Animator",
            "readonly": true,
            "source": {
                "line": 41,
                "path": "src/Animator.lua"
            }
        },
        {
            "name": "AnimationTracks",
            "desc": "References to the loaded AnimationTracks.\n    ",
            "lua_type": "{[string]: AnimationTrack}",
            "readonly": true,
            "source": {
                "line": 47,
                "path": "src/Animator.lua"
            }
        },
        {
            "name": "AnimationPlayed",
            "desc": "Fires after `PlayAnimation()` is executed.\n    ",
            "lua_type": "Signal<(animationTrack: AnimationTrack)>",
            "readonly": true,
            "source": {
                "line": 53,
                "path": "src/Animator.lua"
            }
        },
        {
            "name": "AnimationStopped",
            "desc": "Fires after `StopAnimation()` is executed.\n    ",
            "lua_type": "Signal<(animationTrack: AnimationTrack)>",
            "readonly": true,
            "source": {
                "line": 59,
                "path": "src/Animator.lua"
            }
        },
        {
            "name": "AnimationLoaded",
            "desc": "Fires after `LoadAnimation()` is executed.\n    ",
            "lua_type": "Signal<(animationTrack: AnimationTrack)>",
            "readonly": true,
            "source": {
                "line": 65,
                "path": "src/Animator.lua"
            }
        },
        {
            "name": "AnimationUnloading",
            "desc": "Fires while `UnloadAnimation()` is executing.\n    ",
            "lua_type": "Signal<(animationTrack: AnimationTrack)>",
            "readonly": true,
            "source": {
                "line": 71,
                "path": "src/Animator.lua"
            }
        }
    ],
    "types": [],
    "name": "Animator",
    "desc": "Animators are\nresponsible for playing animations on the Luanoid primarily through the\nCharacterController. Luanoids can accept different Animators by setting the\n`Animator` property on them.\n\nAnimations loaded on the server before the Client Luanoid is created will\nautomatically be replicated.\n\nSee [Custom Animators](/docs/customAnimators) for writing your own\nAnimator.",
    "source": {
        "line": 18,
        "path": "src/Animator.lua"
    }
}