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. Dismiss Notice

Mechanim Beta Tutorial OnAvatarIK not being called

Discussion in 'Developer Preview Archive' started by agentsmith, Oct 16, 2012.

  1. agentsmith

    agentsmith

    Joined:
    May 1, 2010
    Posts:
    132
    When I first ran through the Mecanim Beta Tutorial, I think it was beta 2 or 3, I was able to get everything working just fine. After a few months went by I wanted to revisit the tutorial and brush up on a few things. I'm currently using 4.0 beta 11 and am having an issue with the OnAvatarIK callback function not being called. It's the part of the tutorial where we use idleGrab.

    Following the tutorial and even trying the "Finished" tutorial scene the player's arm doesn't go towards the wrench but only out in front of him. I put a simple Debug.Log in the OnAvatarIK and it's never being called; I have the useCurves box checked in the Bot Ctrl Script. The colliders for the jumps are properly animated (shrinking when I do the barrel jump) but still nothing from the OnAvatarIK function. I put a simple Debug.Log in the OnAvatarMove() and it's being called continuously.

    Although I haven't made any changes to the script, I checked the spelling case of the function and it appears to be correct.
    Is anyone else having an issue like this using beta 11?

    Thanks.
     
  2. Joey_Zhang

    Joey_Zhang

    Joined:
    Apr 17, 2009
    Posts:
    14
    @Robert - Thanks, it works for me too!
     
    Last edited: Oct 18, 2012
  3. Lypheus

    Lypheus

    Joined:
    Apr 16, 2010
    Posts:
    664
    Wow, did I miss an email or was Beta11 a stealth release :) ? Anyhow, thanks for the heads up on that!
     
  4. Hangout

    Hangout

    Joined:
    Feb 1, 2011
    Posts:
    38
    Seems funny, because in the Release Notes they wrote
    .

    It works fine on my end in beta 11.
     
  5. agentsmith

    agentsmith

    Joined:
    May 1, 2010
    Posts:
    132
    I don't have beta 10 so I couldn't test this issue however I did test it in beta 6 and the tutorial worked fine (OnAvatarIK function was being called). I reinstalled beta 11 several times and tried to start a new project from scratch but still OnAvatarIK isn't being called. I submitted a bug report.
     
    Last edited: Oct 16, 2012
  6. frarees

    frarees

    Joined:
    Jun 8, 2012
    Posts:
    29
    Same problem here. I don't know if it's because I'm missing something (I ran the IK scene from Mecanim's demo set and it works), but it doesn't call OnAvatarIK. Tried just by copying the IK.cs script to my project and testing again. No success. Any progress?
     
  7. frarees

    frarees

    Joined:
    Jun 8, 2012
    Posts:
    29
    Unity3D 4.0.0b12 available. Let's see!

    EDIT: No luck for me... on beta 12 OnAvatarIK() isn't called.
     
    Last edited: Oct 16, 2012
  8. agentsmith

    agentsmith

    Joined:
    May 1, 2010
    Posts:
    132
    Just tried with Unity3D 4.0.0b12 and OnAvatarIK() is still not being called. :(


    @frarees - thanks for the heads up on beta 12 being released!
     
    Last edited: Oct 16, 2012
  9. frarees

    frarees

    Joined:
    Jun 8, 2012
    Posts:
    29
    Enable "Pass IK" on the layers you want the IK to be processed.
     
  10. Robert-Lanciault

    Robert-Lanciault

    Unity Technologies

    Joined:
    Oct 17, 2012
    Posts:
    14
    You now need to explicitly activate IK pass for layers you want OnAvatarIK to be called. There is a toggle for that on each layer in Animator Controller Tool. Note that OnAvatarIK now receives the index of invoking layer in parameter. With this, you can now stage multiple IK rigs that need to be called in a specific order. The Bazooka scene in Mecanim beta samples show how to use the multiple IK pass.
     
  11. agentsmith

    agentsmith

    Joined:
    May 1, 2010
    Posts:
    132
    @frarees Robert Lanciault - That worked! Thank you for your help.

    @Robert - I didn't know about the Mecanim samples; I'll definitely check them out.

    If anyone else was also unaware of the samples you can download them here:

    http://unity3d.com/unity/beta/download
     
    Last edited: Oct 17, 2012
  12. kev42100

    kev42100

    Joined:
    Apr 17, 2010
    Posts:
    61
    I activate "IK Pass" in my layer, but still nothing. I've tried with "Mecanim Tute example" and with my project, but none Debug.Log displayed on the console...
    I've just downloaded the 4.0.0f1 this morning...
     
  13. zibizz1

    zibizz1

    Joined:
    Oct 11, 2012
    Posts:
    17
    I have the same issue. In beta 8 i had:
    void OnAvatarIK() and everything was working
    Now i upgraded to 4.0.0f1 and i change function to:
    void OnAvatarIK(int layer) and set IK Pass in Animation Controller and there is no effect

    Scene IK from MecanimSampleBeta11.zip doesn't work as well.
     
  14. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,183
    Hi,

    We renamed the callbacks OnAvatarIK to OnAnimatorIK and OnAvatarMove was also renamed to OnAnimatorMove. Please read the release notes.
    .
     
  15. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Can you please assist me Where is the release notes of 4.0.0f1? I installed the 4.0.0f1 on my Mac, when go to Menu>Help>Release Notes, and it open the Release Notes of version 3.5.6 web links.
     
  16. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,793
    The html start page is in the application folder for the version you are running.

    HTH
     
  17. kev42100

    kev42100

    Joined:
    Apr 17, 2010
    Posts:
    61
    Thanks stramit, with OnAnimatorIK and OnAvatarMove, it works !