[SOLVED] Random Between 2 Numbers

I’m wanting an object to be created randomly in 1 of 2 specific X coordinates. Is there a way of doing this? I was hoping something like “Random(20,800)” would work for the object to be created in either 20 or 800, but no go. I know I can do a random range, but I need one of two specific spots. Is this possible?

Thanks for any help with this.

I think you can use the “Choose” extension for this. You put on expression the numbers you want to get randomly.

Something like this:


You can have a couple of spawner objects. One in 20, other in 800.
Now, with an event you can pick one of them at random.

After picking the random spawner, you can create the object you need using the Spawner X and Y

(PS. I delete the previous object so it is clear where the new object is created)

I hope it helps


you can also do

RandomInRange(100, 200)

Thank you Rasterisko, the Choose extension with the format you showed works perfectly!

And oscuridad666, thank you as well. I tried your solution and it works too. Quite a clever lway of doing it :slight_smile: