I am trying to place an object on the ground like an rts game, but everytime I do that, it’s always floating in the air. How do I make it that so it’s placed right on the ground?
If you are using terrain, then you can use Terrain.SampleHeight to get the height of the terrain. If you object pivot position is not at ground level, then you can use an empty child object that is placed at the foot of your object to calculate how much you need to offset in the y direction to get it to line up with the ground. If your terrain is uneven or slanted, you can sample the normal of the terrain at the point you are placing your object and use that normal to rotate your object accordingly. For larger objects or very uneven terrain you will likely have to use models that extend lower than their ground level, so that corners don’t stick up in the air.