Hello,
For triggers, the network animator knows to access the animator, but for boolean you reference the animator in the script. In c# script the reference for a bool is through: NetworkAnimator.Animator.SetBool
e.g: NetworkAnimator n_animator; Animator anim; n_animator.anim.SetBool("doSomthing", true)
but for triggers its
e.g: NetworkAnimator n_animator; Animator anim; n_animator.SetTrigger("doSomthing");
Can someone explain to me the difference between NetworkAnimator calling a bool vs. a trigger?
n_animator is for synchronize animations arround the network, bool can be synchroniced automatically
, if you set your bool on your animator component, the newtworkAnimator attached, its changed on all instances if are checked true on the component( Inspector ) or the common code:
for(int i = 0; i < anim.parameterCount; i++)
{
n_animator.SetParameterAutoSend(i, true);
}
But triggers are not sent , and you need call trigger on NetworkAnimator component to say all players you are calling the trigger.
https://docs.unity3d.com/ScriptReference/Networking.NetworkAnimator.html
The NetworkAnimator synchronizes the animation parameters that are checked in the inspector view. It does not automatically sychronize triggers. The function SetTrigger can by used by an object with authority to fire an animation trigger on other clients.