# Unity Photon Networking - Cant understand OnPhotonSerializeView

In all tutorials I see that an object sends data over the network and receives the data.

For sync in the same method:

Code:

void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info){
if (stream.isWriting) {
stream.SendNext (transform.position);
stream.SendNext (transform.rotation);
} else {

Debug.Log("never gets called ");

//never gets called...

}
}


But when I test my code, the lower part, where the data gets received, is never executed!

I never see the logs. But the object is SYNCHED because it is set in the inspector:

But the problem is that the object is not interpolated so it looks kind of funny.

So, I need to know how can I make the upper method to work so I can do some interpolation stuff.

• if it is not reading it may depend on the fact that your objects (client, server, proxy) are not correctly initialized. When you instantiate a gameobject over the network you must have a rpefab for client, one or proxy and one for server. Each of those should have the networkview component initialized with the same viewid – Leggy7 Sep 3 '15 at 11:06
• I found it. The problem is that I had to drag the script of the object into the observe field, not the object itself! – mirzahat Sep 3 '15 at 20:02