unity rotate object to match normal

Solutions on MaxInterview for unity rotate object to match normal by the best coders in the world

showing results for - "unity rotate object to match normal"
Leona
20 Jan 2021
1function Update () {
2var hit : RaycastHit;
3Debug.DrawRay (transform.position, -transform.up * 200, Color.red);
4if (Physics.Raycast (transform.position, -transform.up, hit, 200)){
5        transform.up = hit.normal;
6    }
7}
similar questions
queries leading to this page
unity rotate object to match normal