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

Accessing Mecanim states at runtime

Discussion in 'Animation' started by twofivesix, Nov 26, 2013.

  1. twofivesix

    twofivesix

    Joined:
    Nov 26, 2013
    Posts:
    3
    Hi,

    Is it possible to access states inside an AnimationController at runtime?

    I know I can use GetCurrentAnimationClipState to get the clip being played but what if I want to get info about states that are not currently being played? What I'm trying to do is get at the curve info inside a clip that isn't being played and I'll use this info to decide which state to switch to next.

    Ian
     
  2. joessu

    joessu

    Joined:
    Nov 16, 2010
    Posts:
    88
    Upgrade to unity 4.3 and use animation events. In the import of the animation you can scroll to the bottom and set an event.
     
  3. twofivesix

    twofivesix

    Joined:
    Nov 26, 2013
    Posts:
    3
    Yeah I'm already using 4.3 and the event system. However.... I need to get access to the curves and events before they trigger. This will enable me to choose which state to switch to.
     
  4. the_anointed_geek

    the_anointed_geek

    Joined:
    Feb 27, 2014
    Posts:
    2
    Just wondering if anyone has made any progress with this as I alsoi now need to do the same. Change a series of clips. Any Gurus that can help
    ?
     
  5. the_anointed_geek

    the_anointed_geek

    Joined:
    Feb 27, 2014
    Posts:
    2
    Found it now