I have an object (call it item) which I want to sometimes move like a physics sphere. I made a template like this:
Physics Sphere
|- Child
When needed, I instantiate the template and make the item a child:
local physics = World.SpawnAsset(propPhysicsSphere, {
position = item:GetWorldPosition(),
rotation = item:GetWorldRotation(),
})
item.parent = physics
In singleplayer preview it works as expected. In multiplayer preview and after publishing, the item position seems to desync between client and server.
In more detail, it works fine the first time, and I don't see any problem server side. However when I move the item to a second physics sphere at position p, and the sphere then moves to position q, on the client both item and Physics Sphere stay at p, while Child moves to q.
I made a minimal reproduction example:
To work around the problem, each time I create a physics sphere, I also clone the item and destroy the old one.