How do you randomize when the opacity for several objects goes to one hundred

So in my game I am making, I want their to be Lightning. But I want it the lightning to be randomized, so the after a random number of seconds a random lightning objects opacity goes to one hundred for a couple of seconds. How would I do this? Thank you in advance.

1 Like

Hi @Jurassic_P_Ark,

  1. Put your Lightning objects in a list (Data > Lists > create empty list). Make sure you have Advanced CoBlocks enabled (under Settings)
  2. Use the random integer CoBlock to pick a random number from 0 to the number of objects in your list
  3. Use that random number to select an object stored in your list
  4. Apply the opacity effect to that object

Hope that helps! Let me know if you need clarification, but have a go yourself first and see if you can work it out.

Good luck!
Geoff @ TechLeap

How would I use the numbers to choose an object in the lists?
The photo shows what I have so far.

You need to tell the Cospaces what items are into the list, check this post to learn about it :slight_smile:

Now how would I code it to have the opacity of one random object turn on for a random amount of time?

Here you have

image

Thank you, this really helped me add detail to my game!

1 Like