I’m making an RTS and I have a GUI that allows me to click a building I want to place and it copys it so I can place it somewhere on the ground but whenever I click to place the building it is halfway in the ground already (See picture). What is causing this to happen?
if (Physics.Raycast (ray, out hit, Mathf.Infinity, Ground)) {
currentBuilding.transform.position = new Vector3 (hit.point.x, 0f, hit.point.z);
//currentBuilding.transform.position = hit.point;
//Both ways make the building go through the ground...
}