Skip to main content

AnimationSlotPlayer

Acts as a priority slot which can be overridden and play any animation in. See Roblox's animation system for more information.

Functions​

new​

AnimationSlotPlayer.new(animationTarget: ValueObject.Mountable<Instance?>) → AnimationSlotPlayer

Creates a new AnimationSlotPlayer with a target to play the animation on.

SetDefaultFadeTime​

AnimationSlotPlayer.SetDefaultFadeTime(
defaultFadeTime: number
) → () → ()

Sets a new default fade time

SetDefaultAnimationPriority​

AnimationSlotPlayer.SetDefaultAnimationPriority(
defaultAnimationPriority: number
) → ()

Sets a new default animation priority

SetAnimationTarget​

AnimationSlotPlayer.SetAnimationTarget(
animationTarget: ValueObject.Mountable<Instance?>
) → () → ()

Sets an animation target to play the animation on

PromiseStopped​

AnimationSlotPlayer.PromiseStopped(self: AnimationSlotPlayer) → Promise.Promise<boolean>

Promises that the animation has stopped playing

AdjustSpeed​

AnimationSlotPlayer.AdjustSpeed(
id: string | number,
speed: number
) → () → ()--

Callback to clean things up

Adjusts the speed of the animation playing in the slot

AdjustWeight​

AnimationSlotPlayer.AdjustWeight(
id: string | number,
weight: number,
fadeTime: number?
) → () → ()--

Callback to clean things up

Adjusts the weight of the animation playing in the slot

Play​

AnimationSlotPlayer.Play(
id: string | number,
fadeTime: number?,
weight: number?,
speed: number?,
priority: Enum.AnimationPriority?
) → () → ()--

Callback to clean things up

Plays the animation in the slot, overriding any previous animation

Stop​

AnimationSlotPlayer.Stop(
id: (string | number)?
) → ()

Stops the current animation playing

GetCurrentAnimationId​

AnimationSlotPlayer:GetCurrentAnimationId() → string?

Gets the current animation id playing in the slot

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Creates a new AnimationSlotPlayer with a target to play the animation on.",
            "params": [
                {
                    "name": "animationTarget",
                    "desc": "",
                    "lua_type": "ValueObject.Mountable<Instance?>"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "AnimationSlotPlayer"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 46,
                "path": "src/animations/src/Shared/AnimationSlotPlayer.lua"
            }
        },
        {
            "name": "SetDefaultFadeTime",
            "desc": "Sets a new default fade time",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "AnimationSlotPlayer"
                },
                {
                    "name": "defaultFadeTime",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "() -> ()\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 67,
                "path": "src/animations/src/Shared/AnimationSlotPlayer.lua"
            }
        },
        {
            "name": "SetDefaultAnimationPriority",
            "desc": "Sets a new default animation priority",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "AnimationSlotPlayer"
                },
                {
                    "name": "defaultAnimationPriority",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 79,
                "path": "src/animations/src/Shared/AnimationSlotPlayer.lua"
            }
        },
        {
            "name": "SetAnimationTarget",
            "desc": "Sets an animation target to play the animation on",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "AnimationSlotPlayer"
                },
                {
                    "name": "animationTarget",
                    "desc": "",
                    "lua_type": "ValueObject.Mountable<Instance?>"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "() -> ()\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 93,
                "path": "src/animations/src/Shared/AnimationSlotPlayer.lua"
            }
        },
        {
            "name": "PromiseStopped",
            "desc": "Promises that the animation has stopped playing",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "AnimationSlotPlayer"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise.Promise<boolean>\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 111,
                "path": "src/animations/src/Shared/AnimationSlotPlayer.lua"
            }
        },
        {
            "name": "AdjustSpeed",
            "desc": "Adjusts the speed of the animation playing in the slot",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "AnimationSlotPlayer"
                },
                {
                    "name": "id",
                    "desc": "",
                    "lua_type": "string | number"
                },
                {
                    "name": "speed",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "Callback to clean things up",
                    "lua_type": "() -> ()"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 153,
                "path": "src/animations/src/Shared/AnimationSlotPlayer.lua"
            }
        },
        {
            "name": "GetCurrentAnimationId",
            "desc": "Gets the current animation id playing in the slot",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 201,
                "path": "src/animations/src/Shared/AnimationSlotPlayer.lua"
            }
        },
        {
            "name": "AdjustWeight",
            "desc": "Adjusts the weight of the animation playing in the slot",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "AnimationSlotPlayer"
                },
                {
                    "name": "id",
                    "desc": "",
                    "lua_type": "string | number"
                },
                {
                    "name": "weight",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "fadeTime",
                    "desc": "",
                    "lua_type": "number?"
                }
            ],
            "returns": [
                {
                    "desc": "Callback to clean things up",
                    "lua_type": "() -> ()"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 213,
                "path": "src/animations/src/Shared/AnimationSlotPlayer.lua"
            }
        },
        {
            "name": "Play",
            "desc": "Plays the animation in the slot, overriding any previous animation",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "AnimationSlotPlayer"
                },
                {
                    "name": "id",
                    "desc": "",
                    "lua_type": "string | number"
                },
                {
                    "name": "fadeTime",
                    "desc": "",
                    "lua_type": "number?"
                },
                {
                    "name": "weight",
                    "desc": "",
                    "lua_type": "number?"
                },
                {
                    "name": "speed",
                    "desc": "",
                    "lua_type": "number?"
                },
                {
                    "name": "priority",
                    "desc": "",
                    "lua_type": "Enum.AnimationPriority?"
                }
            ],
            "returns": [
                {
                    "desc": "Callback to clean things up",
                    "lua_type": "() -> ()"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 272,
                "path": "src/animations/src/Shared/AnimationSlotPlayer.lua"
            }
        },
        {
            "name": "Stop",
            "desc": "Stops the current animation playing",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "AnimationSlotPlayer"
                },
                {
                    "name": "id",
                    "desc": "",
                    "lua_type": "(string | number)?"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 364,
                "path": "src/animations/src/Shared/AnimationSlotPlayer.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "AnimationSlotPlayer",
    "desc": "Acts as a priority slot which can be overridden and play any animation in.\nSee Roblox's animation system for more information.",
    "source": {
        "line": 8,
        "path": "src/animations/src/Shared/AnimationSlotPlayer.lua"
    }
}