Movement Replication ends up in close but not exact position

Hi, I have an actor (a pickup item) that falls down and lands on a pad where it is supposed to stay. The actor is set to replicated, always relevant and movement replicated. When the server detects that the item lands on the pad, it will adjust its position to perfectly touch the ground. However this final touch is never visible on the clients. The clients have physics simulated to yes so that they make an estimated guess during the simulation, and the final position will be close. But the clients will never have the final perfect position where the server carefully placed the item manually.

I assume there is some sort of replication code going on that will only set the position when the client position is too far off, is that correct? How can I make sure that my item will be placed on the exact final transform where the server put it, not just some “close enough” estimate?

Thanks in advance

Okay after removing physics simulation on the client side completely it seems to work fine. My guess is that the local physics simulation was overwriting the last position update from the server. The item drop animation looks still good enough, apparently the movement replication includes movement prediction, so at least for my use case it seems to go well this way.

The reason for differences is you are having each proxy do their own physics simulations. They’ll be close but never match perfectly.

All actions for pick up and drop should be 100% server.

Pick up: server attaches and sets owner.
Drop: server detaches, sets owner, enables physics.

No client should run any of this logic.

Thanks for the clarification! One question: When I enable or disable phyiscs simulation server side, this is not replicated to the client, correct? I was logging IsSimulatingPhysics on the client on the tick function and it always returned false, even though it was enabled by the server. Nevertheless the movement on the client still looked smooth as if physics were enabled. Was this because of “replicate movement” making it look smooth or what exactly was going on?

Yes, The actors “Replicates & Replicates Movement” handles it.

Everything the server does gets sent over the network. Replicates movement is a bit beefier do to it sending an update per server frame on the physics movement.

Definitely make sure you disable physics on rest.

One tweak to help with network saturation would be to ensure the actors net cull distance isn’t huge.

1 Like