Search Unity

Using Ik For A Weapon???

Discussion in 'Animation' started by Timberghost, Apr 13, 2019.

  1. Timberghost

    Timberghost

    Joined:
    Jun 26, 2018
    Posts:
    10
    Hello, Currently I am working on combat animations when fighting a target, currently i have a ray cast that is fired from my cross hair that sets a game-objects position on the enemies model based on where i am looking. that game-object is what I then use to set where my sword should aim for




    [LIST=1]
    [*] anim.SetIKPosition(AvatarIKGoal.RightHand, aimLocation.position);
    [/LIST]


    However i am only setting the Right Hand to that position, Ideally I would like to set an empty game-object on the sword and have that be set where the AvatarIKGoal is, is there a way to do what i am looking for?

    Ideally I would like a system where it would stretch out the arm and forearm to the max potential so it can reach the farthest it can to hit the aim-location position, currently it does so with the hand but instead i would like it to reach for the tip of the sword

     
  2. Timberghost

    Timberghost

    Joined:
    Jun 26, 2018
    Posts:
    10
    Currently in the video you see the hand goes for the IK Position, what i would like is for the sword based off of a gameobject or something similar to act like the
    AvatarIKGoal.RightHand
    Instead of it being the Right Hand
     
  3. ashish_unity122

    ashish_unity122

    Joined:
    May 18, 2020
    Posts:
    1
    Were you able to find a solution to this? I am trying to solve a similar problem.