- Home /
Error: Transition '' in state 'AnyState' uses parameter 'Death' which does not exist in controller. UnityEditor.DockArea:OnGUI()
I am trying to play death animation from anystate . I got this error : Transition '' in state 'AnyState' uses parameter 'Death' which does not exist in controller. UnityEditor.DockArea:OnGUI()
void Start ()
{
anim = GetComponent<Animator> ();
}
if (m_DeactivateOnDeath) {
Scheduler.Schedule(m_DeactivateOnDeathDelay, Deactivate);
GetComponent<AudioSource>().Play();
anim.SetTrigger("Dead");
}
}
I can only play the death animation only when I click Buy the other animations don't play.
I change the typo error. I gotten this error : Parameter 'Death' does not exist. UnityEngine.Animator:SetTrigger(String)
Here is the code again :
if (m_DeactivateOnDeath) {
Scheduler.Schedule(m_DeactivateOnDeathDelay, Deactivate);
GetComponent<AudioSource>().Play();
anim.SetTrigger("Death");
}
}
Answer by IvovdMarel · Jul 17, 2016 at 11:45 PM
The 'Trigger' refers to a parameter that you have create in your animator.
Go to Window > Animator
In the top left corner you will see both 'Layers' and 'Parameters'
Click Parameters
Click on the little plus icon
Select Trigger
Give it the name 'Death'
Select the Transition (white arrow) from Any State to your Death animation
In the Inspector-window, under the blue graph, you should see a list of conditions
Click on the plus
Select the Death parameter
I did that. I got this error now Parameter 'Death' does not exist. UnityEngine.Animator:SetTrigger(String).
Here is a pic of the animatior controller.
When I click on the death parameter it will play and stay play and wont play the other animations.
I have got the same issue as OP, but this answer doesn't answer the question. He is just simply showing how to trigger animations.
Your answer
Follow this Question
Related Questions
Mecanim new Trigger parameter explanation? 1 Answer
(Unity/Mixamo) Animation won't play all frames 2 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Change parameters 0 Answers
How do I transition from Any State to Die State On My animator controller properly 0 Answers