Skip to main content

ClientAnimationUpdater

Updates the current Animation for an AnimationPlayer_Client Handles syncing to current time and completion of previous states

Types

SyncingState

interface SyncingState {
startTimenumber
hasStartedboolean
durationnumber
currentTimenumber
currentDifferencenumber
currentUpdateTimenumber
animationNamestring
isLoopedboolean
}

Properties

completingStates

ClientAnimationUpdater.completingStates: {CompletingState}

syncingState

ClientAnimationUpdater.syncingState: SyncingState | nil

currentTick

ClientAnimationUpdater.currentTick: number

Functions

new

Constructor
ClientAnimationUpdater.new() → ClientAnimationUpdater

addCompletingState

ClientAnimationUpdater:addCompletingState(
addFirstboolean
) → ()

Types

interface CompletingState {
animationNamestring
startTimenumber
tweenDataTweenData
isLoopedboolean
currentTimenumber
syncStartTimenumber
}

Adds a state to be completed before current state

setSyncingState

ClientAnimationUpdater:setSyncingState(startTimenumber) → ()

Sets the current state to sync from

update

ClientAnimationUpdater:update(
timeUpdateDataTimeUpdateData,
getAnimation(animationNamestring) → (),
currentAnimationNamestring
) → number,string

Gets the current "modelTime", the time used by the animation

Show raw api
{
    "functions": [
        {
            "name": "updateCompletingState",
            "desc": "Completes the given state so that it doesn't look choppy when updating to new time\nIt doesn't use the updater time\nInstead, it uses linear-ish time to update what the state needed to complete",
            "params": [],
            "returns": [],
            "function_type": "static",
            "private": true,
            "source": {
                "line": 39,
                "path": "src/shared/client/ClientAnimationUpdater.lua"
            }
        },
        {
            "name": "updateSyncingState",
            "desc": "Eases \"updater\" time, then, uses that updater time to get model time",
            "params": [],
            "returns": [],
            "function_type": "static",
            "private": true,
            "source": {
                "line": 103,
                "path": "src/shared/client/ClientAnimationUpdater.lua"
            }
        },
        {
            "name": "new",
            "desc": "",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ClientAnimationUpdater"
                }
            ],
            "function_type": "static",
            "tags": [
                "Constructor"
            ],
            "source": {
                "line": 200,
                "path": "src/shared/client/ClientAnimationUpdater.lua"
            }
        },
        {
            "name": "addCompletingState",
            "desc": "Adds a state to be completed before current state",
            "params": [
                {
                    "name": "state",
                    "desc": "",
                    "lua_type": "CompletingState"
                },
                {
                    "name": "addFirst",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 216,
                "path": "src/shared/client/ClientAnimationUpdater.lua"
            }
        },
        {
            "name": "setSyncingState",
            "desc": "Sets the current state to sync from",
            "params": [
                {
                    "name": "startTime",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 253,
                "path": "src/shared/client/ClientAnimationUpdater.lua"
            }
        },
        {
            "name": "update",
            "desc": "Gets the current \"modelTime\", the time used by the animation",
            "params": [
                {
                    "name": "timeUpdateData",
                    "desc": "",
                    "lua_type": "TimeUpdateData"
                },
                {
                    "name": "getAnimation",
                    "desc": "",
                    "lua_type": "(animationName: string) -> ()"
                },
                {
                    "name": "currentAnimationName",
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number, string"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 275,
                "path": "src/shared/client/ClientAnimationUpdater.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "completingStates",
            "desc": "",
            "lua_type": "{CompletingState}",
            "source": {
                "line": 183,
                "path": "src/shared/client/ClientAnimationUpdater.lua"
            }
        },
        {
            "name": "_wasCompletingStateAdded",
            "desc": "",
            "lua_type": "boolean",
            "private": true,
            "source": {
                "line": 187,
                "path": "src/shared/client/ClientAnimationUpdater.lua"
            }
        },
        {
            "name": "syncingState",
            "desc": "",
            "lua_type": "SyncingState | nil",
            "source": {
                "line": 190,
                "path": "src/shared/client/ClientAnimationUpdater.lua"
            }
        },
        {
            "name": "currentTick",
            "desc": "",
            "lua_type": "number",
            "source": {
                "line": 193,
                "path": "src/shared/client/ClientAnimationUpdater.lua"
            }
        }
    ],
    "types": [
        {
            "name": "CompletingState",
            "desc": "",
            "fields": [
                {
                    "name": "animationName",
                    "lua_type": "string",
                    "desc": ""
                },
                {
                    "name": "startTime",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "tweenData",
                    "lua_type": "TweenData",
                    "desc": ""
                },
                {
                    "name": "isLooped",
                    "lua_type": "boolean",
                    "desc": ""
                },
                {
                    "name": "currentTime",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "syncStartTime",
                    "lua_type": "number",
                    "desc": ""
                }
            ],
            "source": {
                "line": 21,
                "path": "src/shared/client/ClientAnimationUpdater.lua"
            }
        },
        {
            "name": "SyncingState",
            "desc": "",
            "fields": [
                {
                    "name": "startTime",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "hasStarted",
                    "lua_type": "boolean",
                    "desc": ""
                },
                {
                    "name": "duration",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "currentTime",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "currentDifference",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "currentUpdateTime",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "animationName",
                    "lua_type": "string",
                    "desc": ""
                },
                {
                    "name": "isLooped",
                    "lua_type": "boolean",
                    "desc": ""
                }
            ],
            "source": {
                "line": 81,
                "path": "src/shared/client/ClientAnimationUpdater.lua"
            }
        }
    ],
    "name": "ClientAnimationUpdater",
    "desc": "Updates the current Animation for an AnimationPlayer_Client\nHandles syncing to current time and completion of previous states",
    "source": {
        "line": 180,
        "path": "src/shared/client/ClientAnimationUpdater.lua"
    }
}