Namespace: UnityEngine
Inherits from: Collider
A CharacterController allows you to easily do movement constrained by collisions without having to deal with a rigidbody.
角色控制器让你在受制于碰撞的情况下很容易的进行运动,而不用处理刚体。
A CharacterController is not affected by forces and will only move when you call the Move funtion. It will then carry out the movement but be constrained by collisions.
角色控制器不受力的影响,仅当你调用Move函数时才运动。它执行运动,但是受制于碰撞。
See Also: Character Controller component and Character animation examples
center | The center of the character's capsule relative to the transform's position. 相对于变换位置的角色胶囊体的中心。 |
collisionFlags | What part of the capsule collided with the environment during the last CharacterController.Move call. 在最后的CharacterController.Move调用期间,胶囊体的哪个部分与周围环境相碰撞。 |
detectCollisions | Determines whether other rigidbodies or character controllers collide with this character controller (by default this is always enabled). 检测其他的刚体和角色控制器是否与本角色控制器相碰撞(默认值始终启用)。 |
height | The height of the character's capsule. 角色胶囊体的高度。 |
isGrounded | Was the CharacterController touching the ground during the last move? 在最后一次移动角色控制器是否触碰地面? |
radius | The radius of the character's capsule. 角色胶囊体的半径。 |
slopeLimit | The character controllers slope limit in degrees. 角色控制器的坡度度数限制。 |
stepOffset | The character controllers step offset in meters. 以米为单位的角色控制器的台阶偏移量。 |
velocity | The current relative velocity of the Character (see notes). 角色当前的相对速度。 |
Move | A more complex move function taking absolute movement deltas. 一个更加复杂的运动函数,采取绝对的运动增量。 |
SimpleMove | Moves the character with speed. 根据速度speed移动角色。 |
OnControllerColliderHit | OnControllerColliderHit is called when the controller hits a collider while performing a Move. 当角色控制器碰到一个可执行移动的碰撞器时,OnControllerColliderHit被调用。 |