please help me fix my network animation
trying to sync animations
pragma strict
import UnityEngine.Networking;
public class anim extends NetworkBehaviour {
var movement : Vector3; var prevpos : Vector3 ; var newpos : Vector3 ; var fwd : Vector3 ;
var sde : Vector3 ;
var anim : Animator;
function Start ()
{
}
function Update(){
newpos = transform.position; movement = (newpos - prevpos);
anim.SetFloat("speed1", Vector3.Dot(fwd, movement));
anim.SetFloat("speed2", Vector3.Dot(sde, movement));
NetworkAnimator.SetParameterAutoSend("speed1", Vector3.Dot(sde, movement)); NetworkAnimator.SetParameterAutoSend("speed2", Vector3.Dot(sde, movement));
}
function LateUpdate(){ prevpos = transform.position; fwd = transform.forward;
sde = transform.right;
}
}
that is my code and i have two eeros
Assets/anim.js(31,17): BCE0020: An instance of type 'UnityEngine.Networking.NetworkAnimator' is required to access non static member 'SetParameterAutoSend'.
both are the same
Your answer
![](https://koobas.hobune.stream/wayback/20220612101030im_/https://answers.unity.com/themes/thub/images/avi.jpg)