While I have been working on environments/levels in Dragonspawn 2 I found that I was having to place significant amounts of clutter objects by hand, and as I’m sure many level designers know, that can involve a whole lot of up close fine tuning of positions to ensure that different objects actually look like they’re sitting on a surface and not floating above or clipping through them.
This got me to thinking, what if I could just press a button and use a Physics Raycast to project downward and have Unity do the rest of the busy work for me?
In the end I wrote a neat little Editor Utility that used a Raycast in conjunction with the collision bounds of an object to determine where the object needed to be placed when ‘Shift + D’ is pressed.