playMaker

Author Topic: Get Animator Current State Info Is Name Action Name Format?  (Read 10081 times)

Grofit

  • Junior Playmaker
  • **
  • Posts: 73
Get Animator Current State Info Is Name Action Name Format?
« on: January 19, 2014, 05:39:01 AM »
Sorry for the raft of questions I am asking at the moment but want to fully know what I should be doing etc.

Currently have a situation where I start an animation via "Animator Play" and I pass this "attack_1" as the name to play. This works fine, however when I call Get Animator Current State Info Is Name and pass it "attack_1" and have a callback for when it matches it never seems to occur.

I read somewhere that you should prefix it with the layer name, but I and not using any other layers, however it is contained within a sub state machine called "attacks" however I have tried prefixing with that (i.e attacks.attack_1) however that doesn't seem to work either, so is there some trick to the naming format?

I have also tried the inverse where I check to make sure it is NOT attack_1 but then it still always goes back to the original state like it never starts as attack_1, which I guess could be true if it is still interpolating between the previous animation and current animation...
« Last Edit: January 19, 2014, 06:21:35 AM by Grofit »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get Animator Current State Info Is Name Action Name Format?
« Reply #1 on: January 23, 2014, 02:31:15 AM »
Hi,

 I am not too sure myself, you should check the samples I created, I used this action, but likely your mecanim states are different,

bye,

 Jean

Grofit

  • Junior Playmaker
  • **
  • Posts: 73
Re: Get Animator Current State Info Is Name Action Name Format?
« Reply #2 on: January 23, 2014, 01:33:57 PM »
Hey,

What samples are you referring to?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get Animator Current State Info Is Name Action Name Format?
« Reply #3 on: January 24, 2014, 07:16:14 AM »
Hi,

the mecanim samples can be found here:

https://hutonggames.fogbugz.com/default.asp?W1031

warning, these samples are for previous version of mecanim, but I think that aspect if still valid.

the unity doc mention something about it as well:

http://docs.unity3d.com/Documentation/ScriptReference/AnimatorStateInfo.IsName.html

bye,

 Jean