Search Unity

Anima2D - Two-handed weapon

Discussion in 'Animation' started by shadowlord1, May 1, 2018.

  1. shadowlord1

    shadowlord1

    Joined:
    Aug 15, 2014
    Posts:
    32
    Hello guys!
    I've a 2D character that is rigged and animated with Anima2D.
    This character is holding a weapon and his arm is controlled by the mobile joystick. I successfully made his right arm rotate accordingly to the joystick by using Quaternion.Euler... (Aim the weapon up, down, etc.)

    But I can't make the left arm hold this same weapon as I rotate the right arm.
    How can I make this possible?
    I tried to attach these 2 bones (left and right hand's bone) in the weapon but it just deforms the weapon's sprite. (Even changing the bone's weight, I didn't succeed).

    How can I make both arms hold the same object and when we change the position of this object in runtime, both arms will hold it?
     
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Look into IK for the other arm. Should be able to make the other hand follow the original hand controlled by the input method.
    Also - I think there might be some useful information (code bits) gleamed from match.target, though that is not the solution you will be using.
     
    shadowlord1 likes this.
  3. shadowlord1

    shadowlord1

    Joined:
    Aug 15, 2014
    Posts:
    32
    That was perfect! Your reply gave me an idea. I've tried everything but not the simplest way. haha
    I've made an IK for the other arm, and then in the hierarchy, I put this IK inside of the right hand, so it will always follow its parent.

    Thank you very much!!!