RPC hitting ball goes out of sync after a while.

Options
I am working on a game where two players hit a ball around that is attached to a rope that is attached to a pole. I "sync" the ball by sending RPCs for each hit, so that the players can run the simulation locally and it goes smoother. However, after a couple of hits the ball goes wildly out of sync. I think part of the reason for this is that the ball travels pretty quick (I'm making a sports game). Do you have any suggestions on what I should do? I have been considering using quantum, but if I can stick with PUN2 and make it work I would like that. Please help someone.

Answers

  • Ravindra5337
    Options
    You have to sync the ball position in intervals, I would recommend using Raise event to sync ball transform, velocity and angular velocity and this has to be carried out by only one client , mostly master client.
  • Nsingh13
    Options
    You have to sync the ball position in intervals, I would recommend using Raise event to sync ball transform, velocity and angular velocity and this has to be carried out by only one client , mostly master client.

    Isn't this the same as using OnPhotonSerializeView?
  • Tobias
    Options
    You can send those values in OnPhotonSerializeView. Have a look at the components we provide (PhotonTransformView, PhotonRigidbodyView, etc) and then roll your own, if those are not a perfect fit (they are not meant to be perfect).