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(animationTargetInstance? | Observable<Instance>) → AnimationSlotPlayer

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

SetDefaultFadeTime

AnimationSlotPlayer.SetDefaultFadeTime(
defaultFadeTimenumber
) → ()

Sets a new default fade time

SetDefaultAnimationPriority

AnimationSlotPlayer.SetDefaultAnimationPriority(
defaultAnimationPrioritynumber
) → ()

Sets a new default animation priority

SetAnimationTarget

AnimationSlotPlayer.SetAnimationTarget(
animationTargetInstance | Observable<Instance>
) → ()

Sets an animation target to play the animation on

AdjustSpeed

AnimationSlotPlayer.AdjustSpeed(
idstring | number,
speednumber
) → () → ()--

Callback to clean things up

Adjusts the speed of the animation playing in the slot

AdjustWeight

AnimationSlotPlayer.AdjustWeight(
idstring | number,
weightnumber,
fadeTimenumber?
) → () → ()--

Callback to clean things up

Adjusts the weight of the animation playing in the slot

Play

AnimationSlotPlayer.Play(
idstring | number,
fadeTimenumber?,
weightnumber?,
speednumber?,
priorityEnum.AnimationPriority?
) → () → ()--

Callback to clean things up

Plays the animation in the slot, overriding any previous animation

Stop

AnimationSlotPlayer.Stop(selfAnimationSlotPlayer) → ()

Stops the current animation playing

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": "Instance? | Observable<Instance>"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "AnimationSlotPlayer"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 40,
                "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": [],
            "function_type": "static",
            "source": {
                "line": 61,
                "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": 70,
                "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": "Instance | Observable<Instance>"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 84,
                "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": 103,
                "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": 153,
                "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": 206,
                "path": "src/animations/src/Shared/AnimationSlotPlayer.lua"
            }
        },
        {
            "name": "Stop",
            "desc": "Stops the current animation playing",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "AnimationSlotPlayer"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 271,
                "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"
    }
}