-
Notifications
You must be signed in to change notification settings - Fork 465
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
fix: NetworkAnimator does not allow disabling or enabling parameters for synch #3586
Conversation
…-or-enabling-parameter-synch
Work in progress.
…-or-enabling-parameter-synch
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.
…er-synch' of https://github.com/Unity-Technologies/com.unity.netcode.gameobjects into fix/networkanimator-allow-disabling-or-enabling-parameter-synch
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.
…-or-enabling-parameter-synch
…-or-enabling-parameter-synch
…-or-enabling-parameter-synch
…-or-enabling-parameter-synch
…-or-enabling-parameter-synch
…-or-enabling-parameter-synch
…-or-enabling-parameter-synch
…-or-enabling-parameter-synch
Converting all legacy ClientRpc and ServerRpc usages over to the newer universal RPC format. Using a pre-allocated Persistent RpcTargetGroup as opposed to the List. When using `NetworkAnimator.SetTrigger` with a client-server network topology and it is the server or host invoking the method, then go ahead and set the trigger since it no longer sends itself an RPC/no longer invokes the InternalSetTrigger via RPC.
…-or-enabling-parameter-synch
EmandM
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay for this update! This is huge!
com.unity.netcode.gameobjects/Runtime/Components/NetworkAnimator.cs
Outdated
Show resolved
Hide resolved
…-or-enabling-parameter-synch
…-or-enabling-parameter-synch
noellie-velez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! 🚀
…-or-enabling-parameter-synch
…-or-enabling-parameter-synch
…-or-enabling-parameter-synch
Updating the NetworkAnimator documentation for this fix.
PVP-124-2 Removing trailing spaces
jabbacakes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed a commit with a general spit and polish of the page (I don't think I've ever had a chance to look at it before), so there are a lot of general changes not limited to the new content. Nothing major tho, just tidying up.
@NoelStephensUnity only real change you might want to look at is in the 'Selecting the authority mode' section. I reworked this one to remove mention of before and after/earlier versions of NGO. Instead it presents the drop-down option first and then says FYI you can do it the old way too.
…-or-enabling-parameter-synch
…ing-parameter-synch
Purpose of this PR
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:
(Above, there is now an "Authority Mode" field and a list of the Animator's parameters that can be enabled or disabled for NetworkAnimator synchronization)
Jira ticket:
MTTB-1485
fix: #3530
Changelog
NetworkAnimator.AuthorityModewhich allows you to select whether theNetworkAnimatorwill use a server or owner authority model for state updates (likeNetworkTransform).Animatorparameters theNetworkAnimatorshould synchronize. This can be done via the inspector view interface or during runtime viaNetworkAnimator.EnableParameterSynchronization.RpcAttributealong with the appropriateSendToparameter.Documentation
Testing & QA
Functional Testing
Manual testing :
Manual testing doneMTTB-1485-Replication Project
Verifying the fix
Replicating the underlying issue
Automated tests:
Covered by existing automated testsCovered by new automated testsDoes 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.
Backports
No backport is needed as this sustainability update will only be available in v2.x.