i need a help with script Animation Trigger
hi everyone i want to write a script but i don't know how help me! i want to do like this 1. OntriggerEnter Start animation 2. OnTriggerExit reverse animation how to do that in unity 5 thanks!
Answer by Mohamor2000 · Nov 28, 2015 at 11:03 AM
you need to make a animator . and make animation .
after that add the animation to the animator ..
and add animator to game object or ui ... and put it enbeld = false.
in script :
public Start()
{
animator an1;
an1 = getcombonent<animator>();
}
public void OnTttiggerEnter (Coleder c1)
{
if (c1 . tag = "tag Object")
{
an1 . Enable = true;
}
void OnTriggerExit(Coleder c1)
{
// here iam sorry i dont know how to reverse the animator .
}
}
thanks for that can you writer script of speed of animation i will put -1 speed and it will work like a reverse
Your answer
Follow this Question
Related Questions
Animation play in reverse OnTriggerExit 1 Answer
About the door animation trigger 0 Answers
How do I destroy an instantiated game object when player leaves trigger area? 1 Answer
OnTriggerEnter and OnTriggerExit called twice despite checking it 1 Answer
Limit an amount of prefabs instantiated in javascript for Unity 5. 0 Answers