I would like to instantiate a new object at a point that is not occupied by another object. Is there an existing method for acheiving this?
Finding an ‘open space’ can be quite difficult, as there are a lot of things to take into consideration. One way of doing this would be to use Physics.CheckSphere on random points until an empty one is found- however, this isn’t guaranteed to produce a result in a finite time, and neither does it find the closest available spot (which, I should mention, makes things even harder).
If your objects have rigidbodies and colliders, you can just spawn it in any location, and let the physics engine sort out the arrangement of the objects. If you’re using some kind of pathfinding / crowd simulation, you could adapt that to this problem as well.
Basically, you can use Physics.CheckSphere to make sure that there are no colliders in an area, but it’s hard to know exactly what points you need to check.