Hi
I’m working on a 2d soccer game, and I got the character and ball sync working pretty well.
But I got a problem with the ball, mainly with shooting.
Now when shooting the ball I’m sending an Rpc, which works fine on the host, but results in visible delay on the remote client.
I’m not really sure how to get around this problem yet, my idea was to set the ownership of the ball to the player who is closer to the ball. The ball is currently a scene object.
Is this a feasible solution or are there other/better ways to get around this?
Thanks
Does it happen all the time? Whats the move logic(code) of the ball? How long are the delays, 0.5sec or longer?
Do you have any parameters in your PunRPC, if yes which? Are you using smooth? Some times it can take little bit more time until the message arrives to the remote client. I guess you had 2 test game windows open for testing? Right?
Yes it happens all the time, and it is to be expected since when the remote client calls the rpc it has to travel to the master client to affect the ball.
It’s just a simple rpc now with add force.
photonview.RPC(“shootball”, PhotonTargets.All, force);
I’m using photon transform&rigidbody view with interpolation on the ball and players.