Search Unity

Push in the right direction for a spider leg

Discussion in 'Animation Rigging' started by Vaspra, Mar 29, 2020.

  1. Vaspra

    Vaspra

    Joined:
    Apr 15, 2018
    Posts:
    34
    This package looks amazing, but at this point trying to figure stuff out I feel I am throwing stuff at the wall and seeing what sticks. I was hoping someone could give me a nudge in the right direction.

    I have a leg, with some bones visualized, whose tip I want to be placed in a location driven by code. The base of this leg is going to be attached to a dynamically moving separate rigidbidy. I need the IK to solve for the tip position of the foot continuously, ideally solving to the constraints labelled below.

    Is this scenario possible? So far whenever any of my objects move through rigidbody motion the whole system just messes up. I've been trying combinations of two-bone constraints, chain constraints, and tried the "rotation constraint" but for the life of me couldn't figure out how it worked.

    Any help, or advice that what I'm doing isn't right for this right now, would be much appreciated.

    upload_2020-3-29_19-30-20.png
     
  2. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    295
    Hi,

    So, it's possible to have an animated hierarchy influenced by rigid body physics, but you have couple of things to watch out for:
    - Make sure to set 'Update Mode' to 'Animate Physics' on the Animator component to ensure that animation evaluates in fixed delta time and properly syncs in with physics evaluation.
    - Since your RigidBody is probably not animated, then its transform is not updated in the Animation Stream that is used by Animation Rigging constraints. To ensure that constraints use the updated transform hierarchy, add a RigTransform component to your RigidBody GameObject (https://docs.unity3d.com/Packages/com.unity.animation.rigging@0.3/manual/RiggingWorkflow.html)

    Here's an example of a simple hierarchy working with this setup: Constraints with Rigidbody.gif
     
    Vaspra likes this.
  3. dennisrsd

    dennisrsd

    Joined:
    Sep 18, 2013
    Posts:
    13
    I am curious too. How to setup the IK for this kind of leg. I made it kinda work with chain constraint, but it will go in wrong rotations very easily. Using the two-bone constraints seems to work great only that, I want to effect 4 bones. Do you have any tips ? The gif is with the chain constrained.
     

    Attached Files: