I created a script that spawn 10 objects at the start of the game in random location.
var n = 10
var object = load("res://Object.tscn")
for i in n:
var x = rand_range(0,300)
var y = rand_range(0,300)
var rand_pos = Vector2(x,y)
var object_instance = object.instance()
object_instance.position = rand_pos
How can I make sure that all of the objects are a certain distance from each other?
I want to leave a minimum distance between them.
Any help will be appreciated, thanks