- Home /
make an event occur after so many seconds?
in my game if you touch a certain object you change color. however my character has three body parts along a vertical axis so i want that it my head only touches and my character backes off my other parts change color a 0.5 seconds after the head.
my color changing script:
function OnTriggerEnter(hit : Collider) {
if(hit.tag == "iceactivator") { renderer.material.color = Color.blue; //i think it would go in here
}
}
Answer by matyicsapo · Aug 17, 2010 at 10:42 AM
http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.html check the function Invoke() and the coroutines stuff(http://unity3d.com/support/documentation/ScriptReference/index.Coroutines_26_Yield.html)for this kinda stuff.
Also iTween(http://itween.pixelplacement.com/index.php) comes to mind. Look for ColorTo ColorFrom and maybe ColorUpdate or similar functions starting with Fade to alter the alpha value of your gameobjects.
Your answer
![](https://koobas.hobune.stream/wayback/20220613071433im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Material doesn't have a color property '_Color' 4 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Loading A Level After 40 Seconds 2 Answers
Jump, fall, and after determined time it's able to jump again. 2 Answers
Interpolating from one color to the other repeatedly 2 Answers