Hello, we've been facing some issues when trying to sync some rigid bodies using PredictionRigidbody. We've tried various approaches but we're currently trying the code from https://fish-networking.gitbook.io/docs/guides/features/prediction/creating-code/controlling-an-object.
In the game the players are able to pick some physics objects and throw them around - for simplicity, in this test scene we're just applying a force to a networked rigid body cube when I press a key, which is what we want to replicate on the client.
In the video you can see a few child objects we've added to compare different ways to sync them.
- on the video: left = host, right = client (both running on the same PC)
- grey = root rigidbody object (the only one with a collider, others are just visuals)
- blue = root NetworkObject's prediction target
- green = child NetworkTransform
- red = manually synced rigidbody state (basically sending PredictionRigidbody.Rigidbody.GetState() via Rpcs)
This approach is working in broad terms, with some caveats we haven't been able to fix yet. The main issue is a very noticeable state jump on the client when the client starts to replicate the state updates instead of a smooth interpolation. From then on they move a lot more smoothly until they get to the same state seen on the host.
Here's our test script and prefab setup. Is there anything wrong or missing there? We've tried various combinations here and these are the best results we've got so far when trying to use as much of what FishNet offers out of the box as possible (i.e. without writing a lot of separate logic to sync/lerp things).
Thanks in advance!