playMaker

Author Topic: [SOLVED] Get Animator Current State Info  (Read 5178 times)

Gav (HeyBud)

  • Full Member
  • ***
  • Posts: 126
    • Tumblr
[SOLVED] Get Animator Current State Info
« on: September 13, 2014, 07:39:17 PM »
Hello,
 I'm using the Mecanim add-on for PM. The state, Get Animator Current State Info, has an option under results for Name. When I run this, it just returns the name of the layer, which in this case is Base Layer. I'm trying to get the State name and I can't figure out how.

I also tried Get Property, but i can't get a hold of the Animator this way. Just Animation which doesn't seem to work if i have clips in the Animator window.

Very confused. TLDR: I'd like to get the State name in the Animator and store as string,  but cant figure it out.

Thanks for any ideas.
« Last Edit: September 21, 2014, 10:02:06 PM by Sarcophagav »

Gav (HeyBud)

  • Full Member
  • ***
  • Posts: 126
    • Tumblr
Re: Get Animator Current State Info
« Reply #1 on: September 21, 2014, 09:59:51 PM »
Ok so, "Get Current State Info Is Name" action from the mechanim add on works so I can compare the animator state. The "name" option  on the other action I was talking about was kind of confusing  since it's returning the Layer name not the state.
« Last Edit: September 21, 2014, 10:01:36 PM by Sarcophagav »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: [SOLVED] Get Animator Current State Info
« Reply #2 on: September 23, 2014, 05:09:28 AM »
Hi,

 yes, this is confusing. Indeed I am confused myself. basically, if you look at how I work with it within the mecanim demo on the wiki, you'll see how it works, and it's based on how they do in pure c#.

 I would like to find a proper example using these api in pre c# then I'll be able to properly comment on this.


 Bye,

 Jean

Gav (HeyBud)

  • Full Member
  • ***
  • Posts: 126
    • Tumblr
Re: [SOLVED] Get Animator Current State Info
« Reply #3 on: September 23, 2014, 05:37:28 AM »
Ok, thanks Jean.

Alatriste

  • Full Member
  • ***
  • Posts: 194
Re: [SOLVED] Get Animator Current State Info
« Reply #4 on: January 31, 2017, 04:38:26 PM »
Sorry for bringing this back again, but I'm having a similar issue:

With the newer version everything is already included in Playmaker, but where is the playmaker animator proxy? I'm trying to use the "Get Animator Current State Info Is Name" but in the field Name I'm not getting anything.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: [SOLVED] Get Animator Current State Info
« Reply #5 on: February 06, 2017, 03:24:48 AM »
Hi,

 Likely you are not referencing the current state properly. you need to write the layer too: "Base.Attak1" for example.

Bye,

 Jean

Alatriste

  • Full Member
  • ***
  • Posts: 194
Re: [SOLVED] Get Animator Current State Info
« Reply #6 on: February 07, 2017, 04:01:41 AM »
Hi Jean,

Thanks for your answer. As I posted in a newer post, the problem was that in the field name, I had to declare a variable with the name of the state controller I wanted to check. For a while I thought that the FSM action would return the actual name of the state controller playing.  :-[