Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

How do you change a sprite after an amount of time?

$
0
0
Hi, I'm trying to make an object in my game where it's sprite changes once it collides with a certain object, but then changes back to the original sprite after 1-2 seconds. I have the first part, but have no idea how to do the second part. Here's my code so far. var spriteImage : Sprite; function OnCollisionEnter2D(col : Collision2D){ if(col.gameObject.tag == "Red") { GetComponent(SpriteRenderer).sprite = spriteImage; } } Thanks in advance.

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>