Answers for "unity rotate object to match normal"

0

unity rotate object to match normal

function Update () {
var hit : RaycastHit;
Debug.DrawRay (transform.position, -transform.up * 200, Color.red);
if (Physics.Raycast (transform.position, -transform.up, hit, 200)){
        transform.up = hit.normal;
    }
}
Posted by: Guest on February-11-2020

Code answers related to "unity rotate object to match normal"

Code answers related to "Javascript"

Browse Popular Code Answers by Language