Skip to main content

Player

Decodes a replay buffer into a tick-indexed timeline and drives proxy instances with interpolation. Supports play, pause, seek and speed. Works on the client and inside Studio edit mode.

Functions​

readHeader​

Player.readHeader(blob: buffer) → Header

Reads only the header of a replay buffer without decoding the op stream.

_characterTemplate​

Player._characterTemplate(
self: Player,
userId: number
) → Instance?

Fetches a character model once per user and reuses clones afterwards, so rewinding never waits on the network or spawns duplicates.

cframeAt​

Player.cframeAt(
_self: Player,
e: Entity,
t: number
) → CFrame?

Returns the interpolated CFrame of an entity at a fractional tick, or nil before its first sample.

_trackSpeed​

Player._trackSpeed(
self: Player,
recorded: number
) → number

Speed an animation track should run at: its recorded speed scaled by the playhead speed, and zero while paused.

step​

Player.step(
self: Player,
dt: number
) → ()

Advances playback by dt seconds and renders. Called automatically each frame unless autoStep is false. In Studio edit mode animation tracks do not advance on their own, so animators are stepped here. In reverse the playhead runs backwards; transforms interpolate either way, and proxies are rebuilt from spawn only when the playhead crosses a tick that carries discrete state.

setReverse​

Player.setReverse(
self: Player,
reverse: boolean
) → ()

When on, playing runs the playhead backwards from its current position.

setLoop​

Player.setLoop(
self: Player,
loop: boolean
) → ()

When on, reaching the end restarts from the first tick instead of pausing.

seek​

Player.seek(
self: Player,
tick: number
) → ()

Jumps to a tick. Seeking backwards rebuilds proxies so discrete state is replayed from spawn. Seeking forwards applies entity state without firing event or channel handlers. Ticks start at 1, so seeking to 0 shows the first recorded state rather than empty proxies.

_rewind​

Player._rewind(
self: Player,
tick: number
) → ()

Rebuilds every proxy so discrete state is replayed from spawn up to tick.

Player.links(self: Player) → {Link}

Everything in this replay that can be linked to an instance in Studio: recorded models (link a prefab to clone it instead of the snapshot) and the unions inside them. Link with Snapshot.link and reload.

Show raw api
{
    "functions": [
        {
            "name": "readHeader",
            "desc": "Reads only the header of a replay buffer without decoding the op stream.",
            "params": [
                {
                    "name": "blob",
                    "desc": "",
                    "lua_type": "buffer"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Header\r\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 90,
                "path": "packages/src/Flashback/Player.luau"
            }
        },
        {
            "name": "_characterTemplate",
            "desc": "Fetches a character model once per user and reuses clones afterwards, so\nrewinding never waits on the network or spawns duplicates.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "userId",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Instance?\r\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 383,
                "path": "packages/src/Flashback/Player.luau"
            }
        },
        {
            "name": "cframeAt",
            "desc": "Returns the interpolated CFrame of an entity at a fractional tick, or nil\nbefore its first sample.",
            "params": [
                {
                    "name": "_self",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "e",
                    "desc": "",
                    "lua_type": "Entity"
                },
                {
                    "name": "t",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "CFrame?\r\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 496,
                "path": "packages/src/Flashback/Player.luau"
            }
        },
        {
            "name": "_trackSpeed",
            "desc": "Speed an animation track should run at: its recorded speed scaled by the\nplayhead speed, and zero while paused.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "recorded",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number\r\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 593,
                "path": "packages/src/Flashback/Player.luau"
            }
        },
        {
            "name": "step",
            "desc": "Advances playback by dt seconds and renders. Called automatically each\nframe unless autoStep is false. In Studio edit mode animation tracks do\nnot advance on their own, so animators are stepped here. In reverse the\nplayhead runs backwards; transforms interpolate either way, and proxies\nare rebuilt from spawn only when the playhead crosses a tick that\ncarries discrete state.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "dt",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 689,
                "path": "packages/src/Flashback/Player.luau"
            }
        },
        {
            "name": "setReverse",
            "desc": "When on, playing runs the playhead backwards from its current position.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "reverse",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 768,
                "path": "packages/src/Flashback/Player.luau"
            }
        },
        {
            "name": "setLoop",
            "desc": "When on, reaching the end restarts from the first tick instead of pausing.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "loop",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 795,
                "path": "packages/src/Flashback/Player.luau"
            }
        },
        {
            "name": "seek",
            "desc": "Jumps to a tick. Seeking backwards rebuilds proxies so discrete state is\nreplayed from spawn. Seeking forwards applies entity state without\nfiring event or channel handlers. Ticks start at 1, so seeking to 0 shows\nthe first recorded state rather than empty proxies.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "tick",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 806,
                "path": "packages/src/Flashback/Player.luau"
            }
        },
        {
            "name": "_rewind",
            "desc": "Rebuilds every proxy so discrete state is replayed from spawn up to\n`tick`.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "tick",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 827,
                "path": "packages/src/Flashback/Player.luau"
            }
        },
        {
            "name": "links",
            "desc": "Everything in this replay that can be linked to an instance in Studio:\nrecorded models (link a prefab to clone it instead of the snapshot) and\nthe unions inside them. Link with `Snapshot.link` and reload.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ Link }\r\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 864,
                "path": "packages/src/Flashback/Player.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Player",
    "desc": "Decodes a replay buffer into a tick-indexed timeline and drives proxy\ninstances with interpolation. Supports play, pause, seek and speed. Works on\nthe client and inside Studio edit mode.",
    "source": {
        "line": 8,
        "path": "packages/src/Flashback/Player.luau"
    }
}