edited May 3 in ORK Support
I have an animation type (let's say animation type ID 40) and I want to play it in a script. I thought it would be adding a this.combatant.Animations.play(40) in buttonplayercontroller, but I had some exceptions.
Post edited by PBoTG on
  • Can you post the error/exception you get?
    Generally, that's the way to do it, i.e. just call the Play function with the ID of the animation type you want to play:
    combatant.Animations.Play(typeID);
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I see what I did. this.combatant = wasn't set yet, so I changed the order in my version ofButtonPlayer extended.

    so I have another question!

    Is there a way to pause a legacy animation? I.E I'm extending the buttonplayer script to incorporate a climbing mechanism, and it goes right back to idle when I stop the idle button but I want to try and get it to pause the animation (so I can resume when I climb again)
  • Actually, if I don't find it in the API, how can I play a legacy animation directly from code? Would I be able to modify the speed to 0 that way?
  • You can just play animations via the Animation component of Unity. Pausing would be setting the speed of an animation (state) to 0.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.