How to find random position in area with no centre?

I am trying to create a part spawning system which spawns parts in a square excluding its centre, and I’m having trouble with working out how I could find a random position in the valid area.

(the parts would spawn in the shaded region)

I’m not sure if this is possible as I have tried looking online and haven’t found any solutions.

Any suggestions would be appreciated!

1 Like

Spawn the Parts within the max values of the X and Z axes (assuming this area is aligned with the X and Z axes).
So a random X value between the min and max X values and a random Z value between the min and max Z values. Let’s call the lower left corner 0,0 and the upper right 15,15.
Now do this

if X is > 5 and < 10 and Z is > 5 and < 10 then return end
spawn the Part at X,Z (since it’s not in the center area)
end