x


How to make flashing lights faster?

Hi all, a fairly easy question I believe but I need a script reference for a flashing light. I have this so far but it is not flashing nearly fast enough:

mgLight.enabled = !mgLight.enabled;

I cant put it into a function start() either as I am calling the light to flash when a button is being pressed. I was thinking about making it flash when an int is at a certain value (i.e. if int lightflash is 1 it flashes, if it is 0 it does not). Obviously i cannot implement this using the yield WaitForSeconds(timer); as that requires function start to work properly. Any ideas about how I could go about this? Regards

more ▼

asked Apr 14 '11 at 05:32 PM

OoglyWoogly gravatar image

OoglyWoogly
82 14 16 23

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

1 answer: sort voted first

WaitForSeconds doesn't require Start. Just make a function that does this, and call the function when the button is pressed.

more ▼

answered Apr 14 '11 at 06:39 PM

Eric5h5 gravatar image

Eric5h5
81.5k 42 133 529

The problem was I couldnt use update as a coroutine.

Apr 18 '11 at 05:14 PM OoglyWoogly
(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:

x445
x41
x16

asked: Apr 14 '11 at 05:32 PM

Seen: 1336 times

Last Updated: Apr 18 '11 at 05:20 PM