When initially adding a GameObject prefab to a scene, is there some way to achieve the following outcome without all the manual labor I'm presently doing in between?
- Add GameObject to Scene so it's positioned slightly above the non-flat terrain's surface
- Ensure that it has a Rigidbody and Collider, and both are properly configured.
- Hit 'play' so the GameObject falls straight down & lands on the terrain's surface.
- Select the GameObject, then copy its transform
- Stop 'play', then paste the copied transform's values into the same GameObject (so it positions it in the exact spot gravity, its rigidbody, and its collider would have it end up moments after play begins).
Likewise, when instantiating a GameObject via C#, is there some way to tell Unity, "position it at (x,z), at whatever 'y' value will place the lowest point of its lowest collider precisely on the surface of the terrain at (x,z)"?
Finally, is there a setting somewhere in Unity to make colliders+GameObjects "buoyant" relative to terrain surface, so that if the GameObject does somehow end up with a transform that positions it below the terrain's surface, Unity will just instantly and unceremoniously "float" it back up instead of having it fall through the ground and plummet into a virtual black hole?