Setting a NetworkAnimator boolean parameter to a value, then starting a Coroutine to set it back to the previous value next frame will cause the latest update to be overriden by the first change.
Description
Setting a NetworkAnimator boolean parameter to a value (e.g. false, was true before), then starting a Coroutine to set it back to the previous value (true) next frame will cause the latest update to be overriden by the first change.
Tl;dr NetworkAnimator doesn't handle well flickering parameter values.
Reproduce Steps
animator.SetBool("Parameter", false);
StartCoroutine(SetItBackNextFrame());
IEnumerator SetItBackNextFrame()
{
yield return null;
animator.SetBool("Parameter", true);
}
Actual Outcome
The animator's value is overriden to false after being true by the NetworkAnimator's UpdateParameters logic. false is the only thing that is replicated.
Expected Outcome
That the local value remains true afterward and that the replicated state is true.
Environment
- OS: Windows 10
- Unity Version: 2020.3
- Netcode Version: develop (1.0.0)
- Netcode Commit: 11922a0bc100a1615c541aa7298c47d253b74937
Additional Context
It seems that the next frame update in a Coroutine is evaluated before the NetworkUpdate (INetworkUpdateSystem). I don't know if we should change the timing of the NetworkAnimator or simply not UpdateParameters for the source of truth (the Owner).
For now, I've fixed it like that on my end:

Backlog MTT-4277
@WhippetsAintDogs Hmmmm, yeah... that was something I was thinking about in the most recent update to NetworkAnimator which pretty much looks very similar to your fixes.
This updated version is available in the develop branch and will be available in the coming update.
Could you test your project against the develop branch and see if that resolves your issue?
(if so I will associate this issue with that PR and close the issue out)
@WhippetsAintDogs This issue should be resolved in v1.1.0.