Photon Network Movement Delay

Hello! First… sorry for my english, not so good!

I’m having troubles testing with player movements on Photon, imagine I open 2 windows:

On play, I instantiate a “Player”, with PhotonView and a Network script with this:

private Vector3 correctPlayerPos;
private Quaternion correctPlayerRot;

void Update()
	{
		if (!photonView.isMine)
		{
			transform.position = Vector3.Lerp(transform.position, this.correctPlayerPos, Time.deltaTime * 7);
			transform.rotation = Quaternion.Lerp(transform.rotation, this.correctPlayerRot, Time.deltaTime * 10);
		}
	}

	
void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
{
	if (stream.isWriting)
	{
		stream.SendNext(transform.position);
		stream.SendNext(transform.rotation);
		
	}
	else
	{
		this.correctPlayerPos = (Vector3)stream.ReceiveNext();
		this.correctPlayerRot = (Quaternion)stream.ReceiveNext();
	}
}

This test is like a 3rd person shooter, when I move one player I can see it on the other windows moving correctly, smoothly, BUT it have a small delay on movement… just some miliseconds, but enough to malfunction…

While player 1 is running, if you take a look at 2nd window it is moving some “steps” behind.
When I shoot with player 1 to an static objective, on window 1 the bullet collides with the objective, on window 2 the bullet doesn’t collide, it’s some “steps” behind…

What can I do? I can’t find a solution, I tried to “predict” the real position adding the velocity variable to the “correctPlayerPos” unsuccessfully…

Thank you

Did you try using the PhotonTransformView to synchronize the positions?

I would recommend doing this tutorial and analyzing their steps thoroughly before heading off on your own: https://doc.photonengine.com/zh-cn/pun/current/tutorials/rpg-movement

Also, as a heads-up, you’re going to want your bullets to be instantaneous and deterministic in the way that they travel/hit to account for lag. If you have a very unforgiving system, it’s going to fail often.