Sync player transform
Options
M4TT
✭
Hi everyone, I'm getting stuck since 3 weeks with this sync over photon.
There is the problem :
This is not my screen but that's exactly whats happens in my game.
I searched everywhere to move on but I'm starting to give up ...
Well, I tried many script ( lerp, extrapolate, smooth move, this one,) Ive wacth many video on youtube about this topic, and I know that this topic has been treated many times but I just dont understand why the result is always the same :[
I have already asked for help on the net but it was not very beneficial : https://answers.unity.com/questions/1447362/photon-syncing.html?childToView=1449501#comment-1449501
What I managed to synchronize (it seems to me) is the rotation.
The best rendering I have for the moment is with this script :
There is the problem :
This is not my screen but that's exactly whats happens in my game.
I searched everywhere to move on but I'm starting to give up ...
Well, I tried many script ( lerp, extrapolate, smooth move, this one,) Ive wacth many video on youtube about this topic, and I know that this topic has been treated many times but I just dont understand why the result is always the same :[
I have already asked for help on the net but it was not very beneficial : https://answers.unity.com/questions/1447362/photon-syncing.html?childToView=1449501#comment-1449501
What I managed to synchronize (it seems to me) is the rotation.
The best rendering I have for the moment is with this script :
private void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) { if (stream.isWriting) { stream.SendNext(transform.position); stream.SendNext(transform.rotation); } else { TargetPosition = (Vector3)stream.ReceiveNext(); TargetRotation = (Quaternion)stream.ReceiveNext(); } } private void SyncMove() { transform.position = Vector3.Lerp(transform.position, TargetPosition, 1f); transform.rotation = Quaternion.RotateTowards(transform.rotation, TargetRotation, 500 * Time.deltaTime); }Thank
0
Comments
-
Did u tryed PhotonTransformView ?
0 -
Yes with all the options availaible ... ( lerp / interpolation / extrapolation )0
-
Any suggest ?
I cant resolve that problem since many weeks, any help is welcome :]0 -
would u share ur project with me ?than i take a closer look0
-
Hi, @S_Oliver
I also Have synchronization problem.
Could you solve this?
It is 2D ball game.
I can share codes.0