A few issues I'm having with PUN in regards to player position

Options

I'm trying to learn PUN by doing a super simple multiplayer game but I'm having a few issues at the moment and any advice would be appreciated.

On each of my players I'm using a Photon View, a Photon animator view and a Photon Transform view. But if a player jumps the other players see it really glitchy, like the player kind of jitters/teleports between several heights, never reaching the actual peak height of the jump on the other players screens. I figured this might be because of the Charater Controller component so I tried to delete the component in a script if(!PV.IsMine) but without the cc component players don't see each other.


As of result of the above, if a player jumps onto a table, because the other players don't see the full jump, on the other players screens the player doesn't make it onto the table so now the local player is on the table, but the other players see him on the ground still. Then as the local player moves, I get desync from where other players see him and where he sees himself.


Is there a way to have Photon transmit the absolute position of each character rather than just the direction of movement to reduce desync?


Edit: Playing around a bit more, I noticed if the local player does a running jump moving forward, the other players see him jump and remain stationary at the point he initiated the jump and then land at the same position but on the local players screen he's landed somewhere different.

Answers

  • I've figured it out. I had to wrap the jump function inside of (!PV.IsMine) to avoid it being calculated on all clients.