playMaker

Author Topic: Can't get the name of current animator state?  (Read 2975 times)

kavery

  • Full Member
  • ***
  • Posts: 149
Can't get the name of current animator state?
« on: November 30, 2017, 11:46:56 AM »
I've tried some actions that sound like they would work like:
Get Animator Current State Info (just gives me the layer name?)
Get Animator Current State Info Is Name (gives me no name info when asked)

Or if anyone knows how I can inform an FSM when an animator state has changed.

(Unity 2017.2 and PM 1.8.3)
Thanks.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Can't get the name of current animator state?
« Reply #1 on: November 30, 2017, 03:33:56 PM »
Hi,
The problem lies in unity, you can only get the name hash and tag hash.

on the '...state info is name' action you can place the state name from one of your animator states into the 'name field' (for example 'State 1')
When the current state on the animator is 'State 1' then it is matching and you can get the result as a bool (true) or send an event

same goes for 'is tag'

another thing you can do is animator sync, you need to get the Animator Proxies on the Ecosystem