- Home /
How to snap object to terrain after already placed in scene?
I was wondering if it was possible that after i placed like all my trees by objects not using the terrain tool, and other objects it there like a button somewhere that says snap to terrain on y axis or something if so that would really help me out instead of manually trying to align them all to the terrain piece by piece. thank you in advance
Can I ask... why did you not use the terrain tool to place your trees?
because when i did everytime my character wouldnt collide with them so i would walk straight through them
Answer by Jovian_IO · Sep 21, 2016 at 01:38 PM
I know this is an old post, But for future people looking for this answer, Hold down Control & Shift, then drag from the center of the translate tool.
Still works in Unity 2021! Don't use the arrows of the movie tool but instead, when you hold down Ctrl+Shift, a white square appears in the center of the move tool and that's what you have to drag to snap.
Answer by Henrique Vilela · May 03, 2011 at 11:49 PM
You can create a script to do a RayCast down on the Start method to position your object on the ground. Something like:
RaycastHit hit = new RaycastHit();
if (Physics.Raycast(transform.position, -transform.up, out hit, Mathf.Infinity)) {
transform.position = hit.point;
}
Answer by jihadkhawaja · Jul 29, 2021 at 11:40 AM
Select all trees and then Hold "V" button then hover near a tree edge and move them towards and edge or pivot.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Export tree from unity 1 Answer
Trees on slopes are floating 1 Answer
Instantiate sometimes creates more then 1 objects 1 Answer
How to make trees respond to a hit? 2 Answers