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.
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);
}
}