Hi,
I’m really new to Unity and this is more of a best practices question, to make sure I am going about development correctly.
Currently I am playing with dynamically generating content, in random locations and rotations. To prevent objects from colliding with one another since they are randomly placed, I add a box collier around the instantiated objects. I then retrieve the boxcollider bounds and make sure it does not intersect with any other bounds (I keep a List iterating over the list everytime I create another object), removing any objects that would otherwise overlap eachother.
All the above logic works fine. The question I have, is if this is really the best way to go about what I am attempting to accomplish? Keep in mind every instantiated object could potentially have to the n’th degree children, each with various colliders, hence why I opted for a box collider around the enter prefab. Also this could lead to somewhat sizable boxcolliders to wrap around the instantiated object. Is there a better method of doing this or am I on the right track?
Any input is welcome, I am really trying to do things correctly and not just make them work.
Thanks