Skip to main content

AnimationTrackPlayer

Plays a single track, allowing for the animation to be controlled easier.

Functions

new

AnimationTrackPlayer.new(
animationTargetInstance | Observable<Instance>,
animationIdstring | number | nil
) → AnimationTrackPlayer

Plays an animation track in the target. Async loads the track when all data is found.

SetAnimationId

AnimationTrackPlayer:SetAnimationId(animationIdstring | number) → ()

Sets the animation id to play

GetAnimationId

AnimationTrackPlayer:GetAnimationId() → string | number

Returns the current animation id

SetAnimationTarget

AnimationTrackPlayer:SetAnimationTarget(animationTargetInstance | Observable<Instance>) → ()

Sets an animation target to play the animation on

SetWeightTargetIfNotSet

AnimationTrackPlayer:SetWeightTargetIfNotSet(
weightnumber,
fadeTimenumber
) → ()

Sets the weight target if it hasn't been set

Play

AnimationTrackPlayer:Play(
fadeTimenumber,
weightnumber,
speednumber
) → ()

Plays the current animation specified

Stop

AnimationTrackPlayer:Stop(fadeTimenumber) → ()

Stops the current animation

AdjustWeight

AnimationTrackPlayer:AdjustWeight(
weightnumber,
fadeTimenumber
) → ()

Adjusts the weight of the animation track

AdjustSpeed

AnimationTrackPlayer:AdjustSpeed(
speednumber,
fadeTimenumber
) → ()

Adjusts the speed of the animation track

IsPlaying

AnimationTrackPlayer:IsPlaying() → boolean

Returns true if playing

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Plays an animation track in the target. Async loads the track when\nall data is found.",
            "params": [
                {
                    "name": "animationTarget",
                    "desc": "",
                    "lua_type": "Instance | Observable<Instance>"
                },
                {
                    "name": "animationId",
                    "desc": "",
                    "lua_type": "string | number | nil"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "AnimationTrackPlayer"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 27,
                "path": "src/animations/src/Shared/AnimationTrackPlayer.lua"
            }
        },
        {
            "name": "SetAnimationId",
            "desc": "Sets the animation id to play",
            "params": [
                {
                    "name": "animationId",
                    "desc": "",
                    "lua_type": "string | number"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 86,
                "path": "src/animations/src/Shared/AnimationTrackPlayer.lua"
            }
        },
        {
            "name": "GetAnimationId",
            "desc": "Returns the current animation id",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string | number"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 95,
                "path": "src/animations/src/Shared/AnimationTrackPlayer.lua"
            }
        },
        {
            "name": "SetAnimationTarget",
            "desc": "Sets an animation target to play the animation on",
            "params": [
                {
                    "name": "animationTarget",
                    "desc": "",
                    "lua_type": "Instance | Observable<Instance>"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 104,
                "path": "src/animations/src/Shared/AnimationTrackPlayer.lua"
            }
        },
        {
            "name": "SetWeightTargetIfNotSet",
            "desc": "Sets the weight target if it hasn't been set",
            "params": [
                {
                    "name": "weight",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "fadeTime",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 114,
                "path": "src/animations/src/Shared/AnimationTrackPlayer.lua"
            }
        },
        {
            "name": "Play",
            "desc": "Plays the current animation specified",
            "params": [
                {
                    "name": "fadeTime",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "weight",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "speed",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 129,
                "path": "src/animations/src/Shared/AnimationTrackPlayer.lua"
            }
        },
        {
            "name": "Stop",
            "desc": "Stops the current animation",
            "params": [
                {
                    "name": "fadeTime",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 149,
                "path": "src/animations/src/Shared/AnimationTrackPlayer.lua"
            }
        },
        {
            "name": "AdjustWeight",
            "desc": "Adjusts the weight of the animation track",
            "params": [
                {
                    "name": "weight",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "fadeTime",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 162,
                "path": "src/animations/src/Shared/AnimationTrackPlayer.lua"
            }
        },
        {
            "name": "AdjustSpeed",
            "desc": "Adjusts the speed of the animation track",
            "params": [
                {
                    "name": "speed",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "fadeTime",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 174,
                "path": "src/animations/src/Shared/AnimationTrackPlayer.lua"
            }
        },
        {
            "name": "IsPlaying",
            "desc": "Returns true if playing",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 185,
                "path": "src/animations/src/Shared/AnimationTrackPlayer.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "AnimationTrackPlayer",
    "desc": "Plays a single track, allowing for the animation to be controlled easier.",
    "source": {
        "line": 6,
        "path": "src/animations/src/Shared/AnimationTrackPlayer.lua"
    }
}