Unity Networking: how to sync animation with child object?

I am doing multiplayer but I am stuck with animation timing. The current player hierarchy is as follows:

enter image description here

The problem is that the Marine is using IK to aim up / down, which means I am using the OnAnimatorIK feature. To use OnAnimatorIK, the Animator component must be attached to the same game object as a script using OnAnimationIK. This means that I have to attach the animator to the marine game object. If I do this, everything will be fine (if not trying to connect to the network).

Now, if I attach the Network Animator to the Player object , the animation will not update remotely. When I try to connect a Network Animator to a Marine object , the Network ID component is automatically added and cannot be removed. If I try to build a Network Identity component attached to a Marine object, I get the error "You can only have one network ID, and it must be attached to the root object." This means that I have to move my Animator component as well as the PlayerIKHandler script into the Player object to get rid of the duplicated Network Identity component.

If I move the Animator component onto the Player object, it breaks my animations (model stands in T-pose) and I don't see any animation even locally.

It is clear that I am doing something wrong, I just don’t know why. How can I synchronize animation with an animator on a child OR how can I animate a model if the animator component is attached to the Player (just a dummy capsule with scripts on it).

+3
animation unity3d unity3d-unet unity-networking


source to share


No one has answered this question yet

Check out similar questions:

909
How do I change restrictions changes?
five
Unity Animation plays in preview, but not during game
2
Unity 5 Network Color Sync
2
Unity [UNET] Object noninterface sync not working
0
Unity Network HTC Vive and Oculus
0
Create new "players" in a subfolder in the "Hierarchy" view | Unity Network with Vuforia
0
Animation object does not move towards the player - Unity
0
How to animate this imported symbol in Unity?
0
How do I destroy another player's child object in a UNET?
0
Child object animation in unity



All Articles
Loading...
X
Show
Funny
Dev
Pics