您的位置:首页 > 其它

模型根据摄像机旋转

2011-06-20 13:35 232 查看
var cam : Transform;
var cameraRelativeRight : Vector3;
// Apply a force relative to the camera's x-axis
function Update()
{
cameraRelativeRight = cam.TransformDirection (Vector3.right);
cameraRelativeRight.y = 0;
transform.rotation = Quaternion.RotateTowards (transform.rotation, Quaternion.LookRotation(cameraRelativeRight), 5);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: