Hello everyone,
i have been to almost every forum and question by now and still cannot find a fix for it. I am working on a multiplayer game and the netAnim.setTrigger("Attack1Trigger");
just won’t play the animation. I have a Debug.log("Please work");
just above the set trigger so i know that it is 110% reaching that line of code.
I have the Network Animator on my enemy and my network components looks like this
The triggers do work if i use GetComponent<Animator>().SetTrigger("Attack1Trigger");
but then it is not synced over the network with other clients. I also tried the SetParameterAutoSend() to make it work but no success there as well.
public override void OnStartServer()
{
for (int i = 0; i < 10; i++)
{
netAnim.SetParameterAutoSend(i, true);
}
}
public override void PreStartClient()
{
for (int i = 0; i < 10; i++)
{
netAnim.SetParameterAutoSend(i, true);
}
}
Could anyone please suggest me a solution to the problem? The netAnim.SetTrigger("Attack1Trigger");
would just not set the trigger and play the animation.
Thanks in advance.