PUN onPhotonSerializeView lag between bigger and bigger
Options
I'm using Photon standalone server and Unity to make multi-player game in Unity. However, I get trouble with photon onPhotonSerializeView, my code is:
I want to get lag of synchronization. At the beginning, lag can be small, such as 100ms, but when the player keeps moving on one device, the lag will be bigger and bigger, and the dummy player on another device move like delay. After some time, the lag can be 20s or more.
My Unity Photon inspector is as follows:
File *playerMovement.cs* contains `OnPhotonSerializeView` code.
Can anyone help me?
I want to get lag of synchronization. At the beginning, lag can be small, such as 100ms, but when the player keeps moving on one device, the lag will be bigger and bigger, and the dummy player on another device move like delay. After some time, the lag can be 20s or more.
My Unity Photon inspector is as follows:
File *playerMovement.cs* contains `OnPhotonSerializeView` code.
Can anyone help me?
0
Answers
-
Try using photon transform view with photon view for player position it might help you otherwise you have to write a code that can calculate ping difference and times difference between sender and receiver to reduce this lag but it will be like predicting things....
you can refer to this link for detailed info :-
https://doc.photonengine.com/en-us/pun/current/demos-and-tutorials/pun-basics-tutorial/player-networking
for calculation and predicting your player moment on the basis of ping and time stamp refer to this ;-
paladinstudios.com/2014/05/08/how-to-create-an-online-multiplayer-game-with-photon-unity-networking/
i hope this will help you0