Forum rules - please read before posting.

Changing Bone Hierarchy in Animation?

Is there a way to change the Bone hierarchy during animation?

My Player is picking up objects. The pickup animation contains the items that the character grabs in their hand. These items have bones that are parented by the Player's hand bones, so there is a smooth, realistic movement when he manipulates them.

But there is an issue. When the animation starts, the item should appear (instead of a scene object it is aligned with) and not move until the hand reaches it. But because the bone is parented by the hand, it is impossible for the item to not move when the hand moves.

So is there a way to parent/connect the bones throughout the animations or anchor the bone of the item temporarily until it is grabbed?

Comments

  • I'm not clear. Is the object being picked up part of the rig, or just being parented to the "hold" bone.

    You can force a bone's position in a custom script using LateUpdate, I believe.

  • The object is part of the rig.

  • It is for a 2D sprite unity complex animation. The way the player interacts with the environment is that the objects (let's say a Can of tuna) are in the scene and also part of the rig. When the player wants to pick up the Can, I align the object in the rig with the object in the scene by walking the Player into a specific coordinate and making the object on the scene invisible, and at the same moment, I make the object in the rig visible.

    The problem is that now I can only do the visibility change in the middle of the animation when the Player's hand reaches the Can, as the can bone is parented to the hand in the rig. That brings up some potential issues with precise timing etc.

    Ideally, I'd like to be able to do the visibility change at the start of the animation (immediately before I play it). But I'm struggling with that because the Can just won't stay in its place before the hand reaches it and moves around.

  • If timing is important, Timeline is often best. You can use a series of Animation and Activation tracks to hide/show the different objects at the correct time, in sync with the main character animation being played.

    Typically, though, I'd say keeping the object itself out of the rig is better practice. You can then use the Character: Hold object Action to place the object in their hand at runtime - the 3D Demo scene does this with the sword object.

  • Thank you, I will dig deep into the Timeline. I tried the Character Hold object some time ago, but it is not ideal, especially when you want them to hold the object in a specific manner.
    In the meantime, I realized I could split the animations handling the objects into two parts: 1) before the object appears and 2) after the object has appeared. In between them, i then put Object: Invisible action to hide the object in the scene.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.