feat: ClientPlayerAvatarNetworkAnimator added to handle client synchronizations [MTT-3152] by fernando-cortez · Pull Request #886 · Unity-Technologies/com.unity.multiplayer.samples.coop
Navigation Menu
- Notifications You must be signed in to change notification settings
- Fork 588
Conversation
Description
This PR rectifies two things:
- A coroutine was used inside
ServerAnimationHandlerto wait untilNetworkAnimator's Animator field had been assigned. That is no longer an issue with Netcode for GameObjects, and thisNetworkBehaviourwas also incorrectly playing an animation on newly joining clients on OnNetworkSpawn(). Instead, theNetworkAnimator's synchronize step should have handled applying its sync data to clients. However, players need to instantiate a model before the synchronize data is applied, and so: ClientPlayerAvatarNetworkAnimatorhas been created to handle: instantiating the player model based on a networked GUID, rebinding this rig to the player's Animator, and applying synchronize data to said Animator.
To validate this fix:
- Host and connect 1 client to host
- Have either of the host or client faint
- Join with a second client, and see that the fainted client's animation is correctly synchronized via NetworkAnimator
Issue Number(s)
Contribution checklist
- [ N/A ] Tests have been added for boss room and/or utilities pack
- Release notes have been added to the project changelog file and/or package changelog file
- Pull request has a meaningful description of its purpose
- All commits are accompanied by meaningful commit messages
- JIRA ticket ID is in the PR title or at least one commit message
- Include the ticket ID number within the body message of the PR to create a hyperlink
- [ N/A ] An Index entry has been added in readme.md if applicable
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit picky thing I commented on...
But it looks good to me from a script perspective! 👍
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters