Skip to content
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

feat: ClientPlayerAvatarNetworkAnimator added to handle client synchronizations [MTT-3152] #886

Merged
merged 4 commits into from
Apr 17, 2024

Conversation

fernando-cortez
Copy link
Collaborator

@fernando-cortez fernando-cortez commented Apr 10, 2024

Description

This PR rectifies two things:

  • A coroutine was used inside ServerAnimationHandler to wait until NetworkAnimator's Animator field had been assigned. That is no longer an issue with Netcode for GameObjects, and this NetworkBehaviour was also incorrectly playing an animation on newly joining clients on OnNetworkSpawn(). Instead, the NetworkAnimator'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:
  • ClientPlayerAvatarNetworkAnimator has 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)

MTT-3152

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

Copy link
Contributor

@NoelStephensUnity NoelStephensUnity left a comment

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! 👍

@fernando-cortez fernando-cortez marked this pull request as ready for review April 17, 2024 15:15
@fernando-cortez fernando-cortez requested a review from a team as a code owner April 17, 2024 15:15
Copy link
Contributor

@NoelStephensUnity NoelStephensUnity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@fernando-cortez fernando-cortez merged commit 60e40b3 into develop Apr 17, 2024
13 checks passed
@fernando-cortez fernando-cortez deleted the feat/playeravatarnetworkanimator branch April 17, 2024 19:16
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.

2 participants