Version: 2023.2
Character control
Character Controller component reference

Introduction to character control

The character in a first- or third-person game usually needs some collision-based physics so that it doesn’t fall through the floor or walk through walls. In many applications, the character’s acceleration and movement are intentionally not physically realistic, so that the character can accelerate, brake and change direction almost instantly and without being affected by momentum.

在 3D 物理中,可以使用__角色控制器__创建此类行为。该组件为角色提供了一个始终处于直立状态的简单胶囊碰撞体。控制器有自己的特殊函数来设置对象的速度和方向,但与真正的碰撞体不同,控制器不需要刚体,动量效果也不真实。

角色控制器无法穿过场景中的静态碰撞体,因此将紧贴地板并被墙壁阻挡。控制器可以在移动时将刚体对象推到一边,但不会被接近的碰撞加速。这意味着可以使用标准 3D 碰撞体来创建供控制器行走的场景,但您不受角色本身的真实物理行为的限制。

可以在参考页面上找到有关角色控制器的更多信息。

Character control
Character Controller component reference