"The observed monobehaviour (XXX(Clone)) of this PhotonView does not implement OnPhotonSerializeView

Options
"The observed monobehaviour (XXX(Clone)) of this PhotonView does not implement OnPhotonSerializeView()!"
I'm new to networking and I'm stuck with this error. I don't know why I get this error.

This is my sync code. I deactivated this sync code and still getting that error when 2 get in room.

public Vector3 RealPosition = Vector3.zero;
public Quaternion RealRotation = Quaternion.identity;

void Update() {
if (!photonView.isMine)
{
transform.position = Vector3.Lerp(transform.position, RealPosition, 0.04f);
transform.rotation = Quaternion.Lerp(transform.rotation, RealRotation, 0.04f);
}
}

void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
{
Debug.Log("Serializing");
if (stream.isWriting)
{
Debug.Log("Writing");
stream.SendNext(transform.position);
stream.SendNext(transform.rotation);
}
else
{
Debug.Log("Receiving");
RealPosition = (Vector3)stream.ReceiveNext();
RealRotation = (Quaternion)stream.ReceiveNext();
}
}

Comments