Skip to main content

ReplicationFocusTracker

Keeps a single hidden part positioned at a point and assigned as a Player's ReplicationFocus, so Roblox streams world content around that point. Reuses one part across position updates and clears the focus (and destroys the part) on cleanup.

The subject is duck-typed at runtime -- anything with a settable ReplicationFocus -- so tests pass a plain table; the production caller always passes a Player.

Functions

SetPosition

ReplicationFocusTracker.SetPosition() → ()

Moves the focus to position, creating and assigning the part on first call.

IsActive

ReplicationFocusTracker.IsActive(selfReplicationFocusTracker) → boolean

Whether a focus part currently exists (i.e. ReplicationFocusTracker:SetPosition has run).

Show raw api
{
    "functions": [
        {
            "name": "SetPosition",
            "desc": "Moves the focus to `position`, creating and assigning the part on first call.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ReplicationFocusTracker"
                },
                {
                    "name": "position",
                    "desc": "",
                    "lua_type": "Vector3"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 47,
                "path": "src/streamingutils/src/Shared/ReplicationFocusTracker.lua"
            }
        },
        {
            "name": "IsActive",
            "desc": "Whether a focus part currently exists (i.e. [ReplicationFocusTracker:SetPosition] has run).",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ReplicationFocusTracker"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 77,
                "path": "src/streamingutils/src/Shared/ReplicationFocusTracker.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "ReplicationFocusTracker",
    "desc": "Keeps a single hidden part positioned at a point and assigned as a [Player]'s\n`ReplicationFocus`, so Roblox streams world content around that point. Reuses one part\nacross position updates and clears the focus (and destroys the part) on cleanup.\n\nThe subject is duck-typed at runtime -- anything with a settable `ReplicationFocus` -- so tests\npass a plain table; the production caller always passes a [Player].",
    "source": {
        "line": 12,
        "path": "src/streamingutils/src/Shared/ReplicationFocusTracker.lua"
    }
}