playMaker

Author Topic: Animator Questions [SOLVED]  (Read 2008 times)

Alatriste

  • Full Member
  • ***
  • Posts: 194
Animator Questions [SOLVED]
« on: February 03, 2017, 03:15:28 PM »
I posted this a few days ago in other old thread so just in case, here I try again:

1) Does anyone knows how to get the name of the current status playing in the animator? I tried with the "Get Animator Current State Info Is Name", but I'm not getting anything in the variable name field. I guess I'm missing to add an extra component to my gameObject, but in the new version there is nothing to add animator wise.

2) Is there a way to play an animation x number of times? I can come up with a few "hard ways" to do it, but I wonder how other users are doing it. I cannot find anything like "Number of Times to Loop Animation: 2"  ;)

Thanks!
« Last Edit: February 06, 2017, 12:45:38 PM by Alatriste »

gheeDough

  • Playmaker Newbie
  • *
  • Posts: 39
    • indie game school
Re: Animator Questions
« Reply #1 on: February 04, 2017, 06:26:42 AM »
Hey there! Don't have an answer for either, sorry, but maybe a workaround for 2).

Rather than trying to find an action for Playmaker, I'd probably just duplicate the animation cycle in Animator. If a cycle needs to be played 3x for example, you could just copy the key frames in the base cycle, copy and paste them twice and save it as a new animation that can then be called.

Not the most elegant solution, but simple and it should work  ;)

Alatriste

  • Full Member
  • ***
  • Posts: 194
Re: Animator Questions
« Reply #2 on: February 04, 2017, 11:19:17 AM »
Thanks gheeDough! Yes, I also have been doing the copy/paste trick, but I thought it might be a simple way to do it.  :) Well, let's see if someone knows about how to get the animator state name.

Alatriste

  • Full Member
  • ***
  • Posts: 194
Re: Animator Questions [SOLVED]
« Reply #3 on: February 06, 2017, 12:45:19 PM »
I finally found the solution to the first question. It was pretty simple indeed:

The name variable field of "Get Animator Current State Info Is Name" doesn't actually return the name of the state. You have to give the input name of the state when you declare the variable. Therefore, the action is looking for that particular value name to check.