hi everyone i want to write a script but i don’t know how help me!
i want to do like this
- OntriggerEnter Start animation
- OnTriggerExit reverse animation
how to do that in unity 5 thanks!
hi everyone i want to write a script but i don’t know how help me!
i want to do like this
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 .
}
}