Syncronize animation : I'm desperate!!!

Hi! I did many tests but I’am still not able to syncronize animations between Local and remote client!

Whit this script I can send the Transform position and it work good

var movementSpeed:float=0.02;

var syncDistanceThreshold:float = 0.1;

var speed:float=0.0;

var lastPosition = Vector3.zero;

var idle:AnimationClip;

var cammina:AnimationClip;

var animNames: String[];

var numeroAnimazione:int;



function Update(){



speed = (transform.position - lastPosition).magnitude*100;

lastPosition = transform.position;



if(speed!=0.0){

numeroAnimazione=1;

}



if(speed==0.0){

numeroAnimazione=0;

}



animation.CrossFade(animNames[numeroAnimazione],0.2); 



if(networkView.isMine){

 if (Input.GetKey("w")){

        transform.Translate (Vector3(0,0,3)*movementSpeed);

}

        if (Input.GetKey("a")){

        transform.Rotate (Vector3(0,-20,0)*Time.deltaTime*5);

}

        if (Input.GetKey("d")){

       transform.Rotate (Vector3(0,20,0)*Time.deltaTime*5);

}

}

}

function OnGUI () {

	  GUILayout.Label(speed.ToString());

}



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

		if (stream.isWriting) {

			var position = transform.position;

			var rotation = transform.rotation;

            stream.Serialize(movementSpeed);

           stream.Serialize(position);

			stream.Serialize(rotation);

			stream.Serialize(numeroAnimazione);

		}

		else {

			position = Vector3.zero;

			rotation = Quaternion.identity;

			stream.Serialize(movementSpeed);

			stream.Serialize(position);

			stream.Serialize(rotation);

			stream.Serialize(numeroAnimazione);

			if (Vector3.Distance(position, transform.position) > syncDistanceThreshold) {

				transform.position = position;

			}

			transform.rotation = rotation;

			

			useNetworkInput = true;

		}

	}

but I don’t find a way to set the correct animation on remote istance. I’m trying whit the “speed” variable but it seems to be valid only in Local because in Remote this variable is updated every 0.1 units (syncDistanceThreshold:float = 0.1;)

Can you help me please? Thanks

help :frowning: