I am making a game in Unity. I am instantiating (circle) GameObjects
on random positions and it works well. What I am trying to do is to instantiate only on positions where there will be no overlapping with other GameObjects
. No solution that I have found on the internet solved my problem so what should i do? Is this possible?
Ok. In order to detect if there is space for your circle you will need to use either a collider or a mathematical/volume equation. But whichever way you do this you will need to reference a position(transform x,y,z) to sample an area and determine if your circle can be spawned there.
You could do one of the following:
It depends of your needs and how likely an overlap is.
Hope it helps.