- Home /
Question by
importguru88 · Jul 22, 2016 at 10:35 PM ·
animatoraicontrolleridhash
How do I call string to hash on anystate animator controller
I am trying to call a hash id . But I am running into some problems . I need to play the die animation on my enemy ai . Tried animation event and still not getting anywhere . The gameobject has to deactivate first and then play die animation. I have a trigger parameter for the die animation . The deactivate code is where the hash tag id needs to go . Help would be appreciate. Here some code and a pic .
static int dieState = Animator.StringToHash("die");
void Start ()
{
anim = GetComponent<Animator> ();
}
// Deactivate the object if requested.
if (m_DeactivateOnDeath) {
Scheduler.Schedule(m_DeactivateOnDeathDelay, Deactivate);
GetComponent<AudioSource>().Play();
anim.SetTrigger("Dead");
}
}
a1.png
(299.1 kB)
Comment
Your answer
Follow this Question
Related Questions
Character controller vs Rigid Body in RTS/RPG 1 Answer
Different animator results over git 1 Answer
RCC AI Issue 1 Answer
Can't properly duplicate an enemy AI 0 Answers