📜  unity 旋转对象以匹配正常 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:38.758000             🧑  作者: Mango

代码示例1
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;
    }
}