I'm trying to play die animation when health reaches zero, but unlike movement animation, die animation only works for host client. I mean, when client killed host client, die animations works for both, but when host client killed client, it only seem to play for a while in host client view; in client, nothing happens. I have tried both clicked and de-clicked the bool in NetworkAnimator component. Here a little part of setbool code. I don't have fully understanding in unet. I'm waiting for advices I really need, thanks in advance. Code (CSharp): public void DecreaseHealth(int _amount) { //I tried to remove this statement to see, if it works, but it doesn't matter at all /* if (!isServer) return; */ if (isDead) return; health -= _amount; if (health <= 0) { isDead = true; GetComponent<Freezer>().CmdDie(); anim.SetBool("isDead", isDead); } }
I still need help !!! Edit : Finally, I solved it. I moved the anim.set function to the update, and set the variable as syncvar. (I'm talking with myself in this post , this is not good)