- Home /
Can anyone Tell me how to Instantiate object above another object, but need the Y value at runtime based object hieght
In my case, I am having one object which acts as terrain but not actual terrain, with different heights. I want to Instantiate some stones on particular x and Z, But I need the Y position which is I don't know exactly, If I gave some common value for Y, it will be spawned sometime above or below the ground level
Comment
Try using raycast and start from max distance from ground and turn ray directly to the ground the hitPoint is your position of your stone