PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

ReplicationFocus

Player

Instance

The ReplicationFocus Player property sets the part to focus replication around a Player. Different Roblox systems that communicate over the network (such as physics, streaming, etc) replicate at different rates depending on how close objects are to the replication focus.

When this property is nil, it reverts to its default behavior which is to treat the local player’s character’s head as the replication focus.

This property should only be set on the server with a Script, not a LocalScript. Note that this property does not change or update network ownership of parts.


Code Samples


Setting a Player's Replication Focus

This example creates a new BasePart and sets the Player's Player/ReplicationFocus to that part.

This demonstrates the functionality of the ReplicationFocus property. You can easily change the part that the focus is set to to change the replication focus.

local part = Instance.new("Part")
part.Parent = game.Workspace
part.Name = "ReplicationFocusPart"
part.Anchored = true

local player = game.Players.LocalPlayer
player.ReplicationFocus = part