Skip to content

fix: NetworkAnimator does not allow disabling or enabling parameters for synch #3586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 12 commits into
base: develop-2.0.0
Choose a base branch
from

Conversation

NoelStephensUnity
Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity commented Aug 6, 2025

This PR addresses the primary issue of NetworkAnimator not providing a way to exclude specific parameters from synchronization to provide users the ability to handle the synchronization of the excluded parameters themselves or to handle them via a calculation performed on non-authority instances.

This PR also includes:

  • Updates to NetworkAnimator's inspector view where you can now select a server or owner authoritative model via drop down as opposed to having to override the class.

MTTB-1485

fix: #3530

Changelog

  • Added: NetworkAnimator.AuthorityMode which allows you to select whether the NetworkAnimator will use a server or owner authority model for state updates (like NetworkTransform).
  • Added: The ability to select which Animator parameters the NetworkAnimator should synchronize. This can be done via the inspector view interface or during runtime via NetworkAnimator.EnableParameterSynchronization.
  • Fixed: WIP

Documentation

  • Includes integration tests.
  • Includes documentation updates. (WIP)

Testing & QA

Functional Testing

Manual testing :

  • Manual testing done
    • Used test project

Automated tests:

  • Covered by existing automated tests
  • Covered by new automated tests

Does the change require QA team to:

  • Review automated tests?
  • Execute manual tests?

If any boxes above are checked, please add QA as a PR reviewer.

Backport

No backport is needed as this sustainability update will only be available in v2.x.

Provide users with a way to disable updating changes to specific parameters.
Don't include excluded parameters during initial synchronization.
Adding the ability to select server or owner authority mode via the inspector view.
Work in progress.
Test project manual tests for animation (of which some are used for integration testing).
Finalizing editor inspector view UI for excluding animator properties.
Added some additional logic to NetworkAnimator.
Added first test that verifies excluding parameters works.
Renamed the new method `ToggleParameterSync` to `EnableParameterSynchronization`. Added  overridden version of `EnableParameterSynchronization` that accepts a string for the name and changed the original method to accept the hash value of the parameter name.

Did some minor clean up in the `NetworkAnimatorStateChangeHandler.NetworkUpdate` method.

Added some additional comments in various places.
Reverted the change in HiddenScriptEditor.
Moved away from a NetworkAnimator custom editor to a custom property drawer to handle displaying the Animator parameters to be synchronized.
Handling the population of parameters and populating the NetworkAnimator.AnimatorParameterEntries during OnValidate.
Had to re-apply unchecking the excluded parameter in some prefabs for testing purposes.
Renaming NetworkAnimatorParameterEntryEditor to  NetworkAnimatorParameterEntryDrawer since it is a property drawer.

Excluding NetworkAnimatorParameterEntryDrawer when the animation package is not installed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant