Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Animation Rigging - proper way to pull shoulder a bit after TwoBone IK Constraint

Discussion in 'Animation' started by marcin-majkowski, Apr 22, 2020.

  1. marcin-majkowski

    marcin-majkowski

    Joined:
    Nov 22, 2014
    Posts:
    10
    HI!

    I use Two bone IK contraint on timeline so my character is holding static object on the scene during animation. It works great.
    But from time to time durring animation my character is to far from the target and my hand then is not at the correct place that i need, so i need to pull a bit shoulder, not to stretch the arm.

    1) what is the proper way to do that?? How to extend Two bone for bones upper in the hierarchy ??

    2) i thought to use another - chain constraint after two bone, so two bone put (hand->lower arm-> upper arm) closer to target, and the chain constrant (hand, lower arm, upper arm, shoulder) to make it exact in the place i need. It works, but i have other problem:

    I can not smooth chain weight. I smooth the weight in update (with Two Bone it works perfect) but it behave like it is not working with weight = 0, and works 100% when weight is more than 0. So for example it is working with weight 0.01. This make my animation skips from "on and off". What is the proper way to smooth it ??
     
    Last edited: Apr 23, 2020
  2. yvesartanim

    yvesartanim

    Joined:
    Oct 4, 2018
    Posts:
    2
    I also was able to reproduce this problem. It seems that Chain IK Constraint supports only on/off state. Is this a known issue ?
     
  3. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    295
  4. WaqasHaiderDev

    WaqasHaiderDev

    Joined:
    Apr 17, 2020
    Posts:
    116
    Hi, so ok. This non smooth behavior of Chain Constraint will be sorted. But what about the functionality of PULL? If we are to make a Full Body IK behavior, we need pull and control its weight. At this git hub page, unity has really very nice examples and setup of scripts for Full Body IK
    https://github.com/Unity-Technologies/animation-jobs-samples

    But the problem in these scripts I faced it was not binding initial pose and Rig with scale of the character other than 1 and rotation of the character other than global Zeros. So I decided to download today unity 2019.4.5f1 and Animation Package 0.2.6. I will include some scripting solution but if there would be the built in solution like Full Body IK scripts, it will greatly save time when we are just implementing regular IK over humanoid characters with pull functinality. (The git hub page I quoted have wonderful and easy setup). Is it possible in future releases? Thanks. :)
     
  5. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    295
    Hi @GameHourStudio,

    There is no plan to add new constraints to the package right now. Animation Rigging was built to provide a core set of constraints with the ability to easily customize and extend the package with additional constraints.

    If you want, the Full Body IK script that is provided in the animation jobs samples can be easily converted to a constraint in the Animation Rigging package. Be aware though that this sample has been written for a humanoid character setup and will not work on generic character setups.
     
  6. WaqasHaiderDev

    WaqasHaiderDev

    Joined:
    Apr 17, 2020
    Posts:
    116
    Thanks for y
    Thanks for your reply. I finally get it working. I am posting my methodology here for other people who encounter the same problem.

    This is the set up I used to make pull feature in my Tuk Tuk Driver Character.

    1) I used Chain Constraint for both arms. I places hand as the tip and chest bone as the root. I did same for both hands. This allowed me to pull the body from hands upto chest by controlling the hands as IK.

    2) Then I used multi parent constraint and assigned the hands as constrained object and Steering Wheel handle as source object. This allowed the hands to move and rotate when ever steering wheel rotates and if ends of the steering wheel are far then due to chain constraints the body upto chest is pulled making the hands all the time at steering.

    3) The only problem I was facing that head was also rotating wierdly. So I placed an object in front of the driver face and used multi rotation constraint. I used head as constrained object and assigned that empty object as source object. This binds the rotation of the head bone to that empty object and the head no more rotate along the rest of chain but has now its own constraint.

    You will have to make some other tweeks as well but this is how I achieved the pull feature. But as OP has mentioned, the chain feature does not work as smooth. It is either OFF or ON. Nothing in between. Also be very careful about the order of constaints. Other wise desired constraint behaviour will not be achieved.
     
  7. ocb

    ocb

    Joined:
    Apr 2, 2015
    Posts:
    2
    Hi, any chance for the Full Body IK script to be converted for Animation Rigging? I think it would be a very useful feature - saves a lot of time and also helps create more natural animations.
     
  8. stor314

    stor314

    Joined:
    Apr 26, 2019
    Posts:
    9
    wow, great idea. this is exactly what i needed to do as well.
     
unityunity