x


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
}

}

more ▼

asked Aug 17 '10 at 10:36 AM

john 2 gravatar image

john 2
75 29 35 46

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Aug 17 '10 at 10:42 AM

matyicsapo gravatar image

matyicsapo
659 12 15 27

thanks! the second link worked.

Aug 17 '10 at 11:51 AM john 2
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5093
x573
x509
x37

asked: Aug 17 '10 at 10:36 AM

Seen: 1276 times

Last Updated: Aug 17 '10 at 10:36 AM