该 ControllerManager 实例管理其分配的 ControllerManager.RootPart 的模拟运动控制。它可以用于构建物理基础的角色控制器。
概要
属性
在角色上激活的 ControllerBase 设置。
所有控制器使用的基础线速度。
所有控制器使用的基础角转速。
在 ClimbController 激活时使用的传感器数据的参考。
描述面向所需方向的单位向量。
在 GroundController 激活时使用的传感器数据的参考。
描述要移动的目标方向的向量。
控制器的力和扭矩应用的 BasePart 位置。
属性
ActiveController
在角色上激活的 ControllerBase 设置。它不保证指定的 ControllerBase 实际上是激活的。如果出于任何原因无法激活 ,例如在角色的 之外或未找到可用作地板的 ,它将保持设置,下一帧将尝试激活它。
ClimbSensor
在 ClimbController 激活时使用的传感器数据的参考。一个 ClimbController 将使用 ControllerPartSensor.HitPart 、 ControllerPartSensor.HitFrame 和 ControllerPartSensor.HitNormal 进行攀登运动计算。通常一个 ControllerPartSensor 设置为 Enum.SensorMode.Ladder 在这里使用。否则,您可以覆盖传感器的输出,以指向要使用的传感器数据。ClimbController
GroundSensor
在 GroundController 激活时使用的传感器数据的参考。A GroundController 将使用 ControllerPartSensor.HitPart , ControllerPartSensor.HitFrame 和 ControllerPartSensor.HitNormal 进行地面移动计算。通常一个 ControllerPartSensor 设置为 Enum.SensorMode.Floor 在这里使用。否则,您可以覆盖传感器的输出,以指向要使用的传感器数据。GroundController
MovingDirection
描述要移动的方向的向量,其磁度在 0 和 1 之间。这被乘以 BaseMoveSpeed 来确定最终目标移动速度。该 RootPart 将尝试根据 ActiveController 定义的规则在这个方向移动。
RootPart
控制器的力和扭矩应用的 BasePart 位置。使用典型的 Humanoid 基于角色,Humanoid.RootPart 被分配为 ControllerManager.RootPart 。