Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Need a little bit of help with an IK script I wrote

Discussion in 'Animation' started by Kane_321, Mar 13, 2018.

  1. Kane_321

    Kane_321

    Joined:
    Aug 6, 2017
    Posts:
    7
    I am an Animator/ Rigger in Autodesk maya and I have been playing around with IK in Unity, first of all it is great fun and everything I have done so far I am really proud of considering I have only started writing C# the last 2 months alongside my animation.

    There is a few little problems which I'm hoping you guys will be able to help me out with?

    I have attached the code file in the post,

    please check out this vid too - https://gyazo.com/68948af9c31357d12300d36140725ef6

    Basically the Ik on the hands and legs only work if I enable the look at first.. It looks like the IK wants to work when I turn on the Boolean in the inspector as it is changing the little red points on the screen, but it just wont change the actual position of the Ik.

    Any help will be super helpful,

    I am not a C# programmer (Yet) Still learning, so I know there will loads of mistakes in this script.. Be gentle with me :eek:
     

    Attached Files:

  2. DominoM

    DominoM

    Joined:
    Nov 24, 2016
    Posts:
    460
    The else statement will always execute if lookAt is false. You should split up the else into sections for each of the ik features you can enable.
     
  3. Kane_321

    Kane_321

    Joined:
    Aug 6, 2017
    Posts:
    7
    Ok thank you for you help, I will give that a go now :)
     
  4. Kane_321

    Kane_321

    Joined:
    Aug 6, 2017
    Posts:
    7
    DominoM likes this.