Unity-Technologies / com.unity.netcode.gameobjects

Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.
MIT License
2.16k stars 435 forks source link

Do not require component Animator on NetworkAnimator. #2812

Closed jeffgamedev closed 8 months ago

jeffgamedev commented 10 months ago

This PR removes the hard RequireComponent of Animator from component NetworkAnimator. The reason is that NetworkAnimator does not in fact require an Animator object to be on the game object, and functions just as well accessing a child game object's Animator.

The NetworkAnimator requires a reference to any Animator, not an Animator on the same game object. In the current implementation, this requires my Player game object to have an unused Animator attached due to the component being required.

Changelog

Suggestions for the future

Allow NetworkAnimator to throw 1 warning if the Animator reference is empty instead of constantly throwing errors.

unity-cla-assistant commented 9 months ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


jeffgamedev seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

NoelStephensUnity commented 8 months ago

This was migrated to the public repository in #2872 and will be included in the v1.9.0 update. Thank you for your submission!