Mecanim Animations in Multiplayer Game??

Hi guys, since few days i’m making my multiplayer shooter game, and now i have big problem.

When players are connected to serwer they can see how their own character is walking (i mean animations) ,but when other player is walking, he is just playing idle animation.(but is moving)

So have you guys any ideas what to do with this??

There is my player movement script

private var animator: Animator;
var h: float;
var v: float;
function Start () {
animator = GetComponent(Animator);
}
function Update () {
if(networkView.isMine==true)
{
h = Input.GetAxis(‘Horizontal’);
v = Input.GetAxis(‘Vertical’);
if(Input.GetButton(‘kuc’))
animator.SetBool(‘kuc’,true);
else
animator.SetBool(‘kuc’,false);
if(Input.GetButton(“celowanie”))
animator.SetBool(‘celowanie’,true);
else
animator.SetBool(‘celowanie’,false);
}
}
function FixedUpdate(){
animator.SetFloat(‘predkosc’, v);
animator.SetFloat(‘kierunek’, h);
animator.SetFloat(‘bok’, h);
}

Mecanim doesn’t get synced through networkview. Additionally you do your Animationstuff in a networkView.isMine statement.
Either do a general implementation of Animations outside of the if-statement or sync it via Bitarrays.

Ok, thank you for answer, but i can’t find informations about “Bitarrays”, can you send mi some website, or documentations for it???

Or if you can i would like to see how this should look like
for example this single animation, how to sync it??

if(Input.GetButton(‘kuc’))
animator.SetBool(‘kuc’,true);
else
animator.SetBool(‘kuc’,false);

Any ideas? :smile:

Ok, i have it!

it looks like this now:

@RPC
function Update () {

if(Input.GetButton(‘ctrl’) networkView.isMine )
{ networkView.RPC(“animations”,RPCMode.All);}

@RPC
function animations( ){
animator.SetBool(‘flip’,true);
}

And it is working!!! :smile: