UI animation when enter trigger, then destroy self after (X) time
I have a question of how to make a UI animation that when you (tag "player") enter trigger, the UI automatically play the "open animation" and for 4 seconds, it play "close animation" and destroy the trigger.
Example: The UI is not Active at the beginning You EnterTrigger --> the UI show up and play animation "open animation" --> delay for 4 seconds with "idle animation" (which is no change to the UI) --> "close animation" and destroy itself (no more trigger), you will never see that UI or interact with that trigger again?
I have my script here but i dont know how to set the animation :<
void Start(){
image1.SetActive(false);
}
void OnTriggerEnter(Collider col) {
if (col.tag == "Player") {
image1.SetActive(true);
}
}
Your answer
Follow this Question
Related Questions
How do I add UI pop up with this script? 0 Answers
Starting animation on specific time (%) with scene preview? 0 Answers
How to remove flashing screen when changing Canvas Render Modes 0 Answers
How to Get Cumulative Gameplay Time 0 Answers
Best way to implement character(2d) interaction with other objects or characters 0 Answers