I am getting started with Unity and am just trying to get my head around the units. What are these units? It seems they are their own ‘quantity’ and to treat 2 units as 2 times the value of 1 unit.

Anyway - I am trying to workout how to optimally calculate transforms to objects sit exactly where I want them to.

In my scene I have a terrain and a cylinder as so:

As you can see my cylinder is floating. I want the cylinder to sit perfectly on top of the terrain.

So.

My terrain is at the following transform: 0,0,0 and scale 0,0,0
(not sure how to tell it’s dimensions yet).

My cylinder is part of a new object, as so:

162129-imgupload2.png

My FirstPersonPlayer is at transform: 85.9,2.165,51.8 and scale 1,1,1.
My Cylinder is at ‘localposition’ 0,0,0 and local scale 1.2,1.8,1.2

Now - the transform of FirstPersonPlayer on the y axis appears to be what I need to correct.

Currently it is set to 2.165 and is floating a bit above the terrain.

Through manually shifting it, around 1.85 looks about right - but I want to know how to calculate that, rather than doing a finger in the air ‘that looks about right’.

Can anyone help me? (Before you suggest using gravity etc , I actually am, but don’t want the player falling as soon as they start, however slight that may look or feel.

Many thanks,

You don’t have to compute anything, hold Shift + Control and drag the object. Every game engine ever made calls this “Snap to Ground” – that is the answer, i got quick answers from StackOverflow - Explanation of how to calculate transforms in Unity - Stack Overflow