How can I pick a random object within a distance from a position?

Hello. I’m trying to implement a system that randomly picks between a number of spawn locations to place an enemy at in an arena. However, to prevent interfering, I need it to only consider those within a certain distance of the center of the arena. How can I implement a system to handle this?

Here’s one of the arenas, and the coloured dots are the spawn locations. Each colour is a different object, but they are all under the class “spawners”.

Arena Pic

I believe there is an extension for extra picking tools. I will have to check.

Thank you. Please do.

The extension doesn’t have it but I found a way to do it. Loop through all the spawn ones within the required distance. If it is in that distance, add 1 to a counter. Once you have looped through all of them, you should have a number for how many there are. Generate a random number between 1 and that number. Next loop through all of the spawns again. If it is within the correct distance add one to a counter, but this time, check if the number of the counter is equal to the random number. If so, choose that spawn. Reply if you need more help :smiley:

Thanks. I’ll try that and get back to you.

Well I found a slightly easier method, but thank you anyway.