OnSerializenetworkView not doing anything??

Hi… well, I have no idea what I’m doing wrong here. I am trying to sync the position of my car using the OnSerializenetworkView function so that I can later add in dead reckoning.

I already have the script in the observed part of the network view with it set to “unreliable”, and for some reason, nothing is happening in the function. Neither print(“Sending”); or print(“Reciving”); is showing up.

Elsewhere in the code, I do have a few RPC’s and they are all working fine.

Anyone have any idea what I could be doing wrong?

function OnSerializenetworkView(stream:BitStream,info:NetworkMessageInfo){



if(stream.isWriting)

{

print("Sending");

var pos:Vector3=transform.position;

stream.Serialize (pos);

}

else

{

print("Reciving");

var posReceive:Vector3=Vector3.zero;

stream.Serialize(posReceive);

transform.position=Vector3.Lerp(transform.position,posReceive,0.9);

}



}

Spelling mistake: the correct name for this method is OnSerializeNetworkView (with a big ‘N’).