Rigidbody.freezeRotation 冻结旋转

var freezeRotation : bool

Description描述

Controls whether physics will change the rotation of the object.

控制物理是否改变物体的旋转。

If freezeRotation is enabled, the rotation is not modified by the physics simulation. This is useful for creating first person shooters, because the player needs full control of the rotation using the mouse.

如果freezeRotation被启用,旋转不会被物体模拟修改。这对于创建第一人称射击游戏时是很有用的,因为玩家需要使用鼠标完全控制旋转。

using UnityEngine;

using System.Collections;



public class example : MonoBehaviour {

	public void Awake() {

		rigidbody.freezeRotation = true;

	}

}
// Freeze the rotation

//冻结旋转



rigidbody.freezeRotation = true;
Page last updated: 2011-1-29
Rigidbody.freezeRotation 冻结旋转_unity3d游戏脚本制作教程-游戏蛮牛出品

Rigidbody.freezeRotation 冻结旋转

var freezeRotation : bool

Description描述

Controls whether physics will change the rotation of the object.

控制物理是否改变物体的旋转。

If freezeRotation is enabled, the rotation is not modified by the physics simulation. This is useful for creating first person shooters, because the player needs full control of the rotation using the mouse.

如果freezeRotation被启用,旋转不会被物体模拟修改。这对于创建第一人称射击游戏时是很有用的,因为玩家需要使用鼠标完全控制旋转。

using UnityEngine;

using System.Collections;



public class example : MonoBehaviour {

	public void Awake() {

		rigidbody.freezeRotation = true;

	}

}
// Freeze the rotation

//冻结旋转



rigidbody.freezeRotation = true;
Page last updated: 2011-1-29