Search Unity

Animating arms with tools/weapons

Discussion in 'Animation' started by Zexanima, Apr 16, 2014.

  1. Zexanima

    Zexanima

    Joined:
    Jan 2, 2014
    Posts:
    33
    I looking for a good way to place weapons/tools in the hands and animate them accordingly. My current approach was to make the animation with the hands, attach the GameObject to a bone in the hand, then just animate it and let the game object follow. For simple things this works fine, like punching and swinging a sword (assuming the hand looks like it is gripping things properly). However, this looks sloppy when doing something like aiming down the sights of a gun or anything that takes any kind of precision with the object in hand. In cases like this I figured it would be best to some how animate the hand to follow the object and move the object but I can't figure out a way to do this in Unity. Any suggestions on a good way to do this would be great.
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Sounds like you're looking for IK. If you have Pro, you can use OnAnimatorIK(). Otherwise consider getting Final IK for Free or Pro.
     
  3. Zexanima

    Zexanima

    Joined:
    Jan 2, 2014
    Posts:
    33
    Thank you, I'll give that a look!
     
  4. Zexanima

    Zexanima

    Joined:
    Jan 2, 2014
    Posts:
    33
    Oh, so this is going to cost me money anyway I go about IK. Guess I'll have to stick with sloppy animations then.
     
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    You can write your own IK, but that can be a pretty big task.
     
  6. Zexanima

    Zexanima

    Joined:
    Jan 2, 2014
    Posts:
    33
    Has to be some other way to go about it.
     
  7. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    What you described in your original post was inverse kinematics.

    You could also create your source animations so they align perfectly without any need for post-processing of bone placement.
     
  8. alarm656

    alarm656

    Joined:
    Jul 6, 2013
    Posts:
    111
    Hi, What is IK? It's helps to my problem? My problem is disable animation from the hand when the character model runs.
     
  9. gameseizer_00

    gameseizer_00

    Joined:
    Dec 20, 2013
    Posts:
    124
    who are you? it is inverse kinematics, dude
     
  10. alarm656

    alarm656

    Joined:
    Jul 6, 2013
    Posts:
    111
    Thank you. I'm new in Unity
     
  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
  12. alarm656

    alarm656

    Joined:
    Jul 6, 2013
    Posts:
    111
    Thank you very much TonyLi!
     
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Happy to help!