- Home /
Question by
DoctorTM · Jun 07, 2014 at 11:53 PM ·
animationtransition
Animation stransition problem
I have a problem with transitions. I want to make an animation of elevators' doors. When the player enter to the elevators' trigger its trigger the animation to open the doors. When he exits the elevators' trigger it closes the doors. everything is working until this point, the animation stuck on the "closing doors" state and does not go to the default.
here the code for the opening of the doors:
void OnTriggerEnter2D (Collider2D other)
{
if (other.gameObject.tag == "Player")
ElevatorAnimation.SetTrigger (OpeningDoors);
}
here the code for the closing:
void OnTriggerExit2D (Collider2D other)
{
if (other.gameObject.tag == "Player")
ElevatorAnimation.SetTrigger (ClosingDoors);
}
Comment
Your answer
Follow this Question
Related Questions
Managing Animations & Transitions 1 Answer
Combining two animations to be one 0 Answers
Can I make animations snap to a frame? 1 Answer