Closed f2069 closed 4 months ago
I'll make sure this gets looked at especially since you got us a repo package, but it will have to be marked as low priority. I don't believe this is a NetworkAnimator bug because the NetworkAnimator doesn't unset triggers(unless you tell it to), Unity typically does that automatically when a condition is met.
More likely it's something in your Animation Controller.
Unfortunately the bug is in NetworkAnimator otherwise it would not work correctly in the build or previous version of FishNet. But now this occurs only in the editor and in the development build. I've attached the package with animator.
networkAnimator.SetTrigger(triggerKey);
NetworkAnimator.UpdateTrigger
and _animator.SetTrigger(hash);
https://github.com/FirstGearGames/FishNet/blob/40686750fe5028d6a61941dcbffd8d0ec1671c41/Assets/FishNet/Runtime/Generated/Component/NetworkAnimator/NetworkAnimator.cs#L1396-L1400NetworkAnimator.TargetAnimatorUpdated
and it's set same trigger second time https://github.com/FirstGearGames/FishNet/blob/40686750fe5028d6a61941dcbffd8d0ec1671c41/Assets/FishNet/Runtime/Generated/Component/NetworkAnimator/NetworkAnimator.cs#L1433-L1442In version 3.11.8 condition #if !DEVELOPMENT
was been inverse and works fine.
https://github.com/FirstGearGames/FishNet/blob/4882f1c228a5fd00bdc97e27b269b6dfe740f945/Assets/FishNet/Runtime/Generated/Component/NetworkAnimator/NetworkAnimator.cs#L1423-L1442
The development check should not even be needed in this case. It was put into place to save bandwidth for clientHost but realistically the savings would be incredibly insignificant and the checks add cpu costs.
I've removed the #if DEVELOPMENT/!DEVELOPMENT block entirely which should resolve the issue.
Resolved in 4.3.6
General Unity version: 2021.3.18f1 Fish-Networking version: 4.3.4R Pro Discord: https://discord.com/channels/424284635074134018/1248141217498267740 Package: Animator.BugReport040624.unitypackage.zip
Description Triggers on NetworkAnimator sets twice on server in editor and developer build. In release build works fine. On 3.11.8R bug not reproduced.
Replication Steps to reproduce the behavior:
Expected behavior Triggers must be set in animator once in editor and in any builds.
Screenshots