3

I'm making a multiplayer but I got stuck at syncing animations. My current player hierarchy is following:

enter image description here

The problem is that Marine object uses IK to aim up/down which means that I use OnAnimatorIK function. In order to use OnAnimatorIK, the Animator component must be attached to the same gameobject as the script using OnAnimationIK. This means I must attach the Animator to the Marine gameobject. If I do this everything works fine (if not trying to Network animations).

Now, if I attach Network Animator to the Player object, animations will not update remotely. When I try to attach the Network Animator to the Marine object, Network Identity component is automatically added too and it can not be removed. If I try to build with Network Identity component attached to Marine object I get error saying "You can only have one Network Identity attached and it must be attached to the root object". This means I should move my Animator component as well as the PlayerIKHandler script to the Player object to get rid of the duplicate Network Identity component.

If I do move the Animator component to the Player object it breaks my animations (model stands in T-pose) and I don't see anything animating even locally.

Clearly I'm doing something wrong I just don't know why. How could I sync animation using animator on child object OR how can I animate the model if the animator component is attached to the Player (just a dummy Capsule with scripts on it).

Muhammad Faizan Khan
  • 10,013
  • 18
  • 97
  • 186
Jonathan
  • 325
  • 2
  • 3
  • 24
  • Keep thing simple, just attach network identity and network transform to you player object and rest your animation related script or component to Marine object and let me know if this working or not? – Muhammad Faizan Khan Jan 09 '18 at 09:29

0 Answers0