The extension is picking a new random number for each array. You can set a variable to a random number and use it for both arrays. If you declare or setup the variable then you can use the variable name without the Variable() part. Arrays start at zero, so you need to subtract 1 from the max count…
Another option is to use a placeholder object, add as many instances to the screen as needed and then hide them at startup and pick a random object and use it’s x,y or CenterX(),CenterY()
I used mouse released for testing so it would only create one at a time.
The placeholder method is much easier to place and adjust plus, you can use a Boolean variable (or other method) to prevent the same spawn point from being used.
Add a placed Boolean to the placeholder object. Leave it set to false. Once there aren’t any objects with placed set to false it resets them all to false.
@Keith_1357, your solution with the spawn points it so simple yet brilliant, works exactly as I needed
@MrMen, thanks for the input, I tried your solution as well, but I’m doing something wrong.
I’m not sure I understand the random index variable. Do I create a new variable with numbers 0-3, or where does this variable come from? (I don’t fully understand variables yet).
It’s in the screen snip of the events I included in my post. The variable rand_idx is set to a random number between 0 and the size of Spawn_Object_X. You then use that randomly generated value to select the X & Y values from the same position in Spawn_Object_X and Spawn_Object_Y.