[SOLVED] Make Random properties for instances

I’m trying to make a Space Shooter game, in which you have to shoot meteors.
However, I want these asteroids to have random scale and a random starting angle (so the asteroids rotate in a non-similar way)
This is my code:

However, what happens is:
Every 1.2 seconds a new meteor is created, and ALL meteors in the scene are aplied a different size and angle EVERY 1.2 seconds.

Please help.

scale and size are like same.

And isn’t this what you want.

You need to use subevent for the scale and angle to go to the specific one you created… I tested it and it works…


Hey! It didn’t work the way I planned.
I want them to set the scale and angle ONLY once, when being created. and they keep this value forever.

But that is exactly what it does. It creates an asteroid at a random Y value, then it gives it a random starting angle and a random scale and they keep these values until they disappear…

This event won’t quite work as expected since it’s missing trigger once.
Once the timer is past 1.2 seconds infinite asteroids will be created.

Also, while subevents SHOULD work, if you’re wanting to target a created object, you normally want to have the actions in the same event box.

It doesn’t need trigger once since it resets the timer… And it works, I tried it… Here it is…


1 Like

You can download the example from here…


Yep, I totally missed the reset timer in there. Should work fine.

Oh! I figured out the problem!
Old code:

New code:

I forgot to add the “Change X position” and “Rotate” in a sub-event