Physic Replication Bug: “Camera Hack” does not work in all circumstances - it still causes some data to replicate when using BodyPositions, Humanoids, and other physics interacting instance types.
Backstory:
Right now there is a rather useful (but extremely janky!) hack called the “Camera hack”.
With this hack developers can parent fully simulated server instances underneath a camera, and this prevents those instances from producing any replication data to clients, while still allowing the instance to function on the server. Eg: a ball will roll, but it won’t send any visual or physics data.
This is used for a host of reasons, including allowing custom replication.
The bug:
This trick only seems to work for raw, unadorned physics objects. Attaching things like BodyMovers to instances parented under the camera causes replication data to be consumed by the client, even though nothing is being actually sent.
Affected instances:
- Humanoid
- BodyPosition
- BodyAngle
- BodyVelocity (and family)
- AlignPosition (and family)
(and possibly a bunch more)
Setup: a camera with a bunch of unanchored balls inside
What the client sees:
Notice there are no balls, and also no replicated data cost on the client. However the balls are still happily rolling around on the server
The bug: After adding a BodyPositions to one of the balls, its starts sending out replication data (3kb/s).
Expected behavior
(I mean ideally the camera hack would be replaced with selective replication… but alas!)
What should happen is any instance underneath a camera should never, ever, be able to replicate any data.