Class · inherits ControllerBase
SwimController
The ControllerBase that moves a ControllerManager character
while it is swimming.
About SwimController
SwimController is the ControllerBase that a
ControllerManager activates to move a physics-based character while it
is swimming. When it is the manager's
ControllerManager.ActiveController, it drives the
ControllerManager.RootPart toward the manager's target velocity
(scaled by ControllerBase.MoveSpeedFactor), pitches the character to
face the ControllerManager.FacingDirection, and rolls it to keep it
oriented in the water. Pitch rotation is tuned with
SwimController.PitchMaxTorque and
SwimController.PitchSpeedFactor, and roll with
SwimController.RollMaxTorque and
SwimController.RollSpeedFactor, with the speed factors scaled by
ControllerManager.BaseTurnSpeed. A SwimController only
functions when parented to a ControllerManager.
Properties 4
PitchMaxTorque
: floatThe maximum torque used to rotate to the desired pitch.The maximum torque used to rotate on the local X axis to the desired pitch orientation. Has no effect if
ControllerBase.RigidityEnabledis true.PitchSpeedFactor
: floatMultiplied byControllerManager.BaseTurnSpeedto determine the maximum angular velocity for pitch.Multiplied by
ControllerManager.BaseTurnSpeedto determine the maximum angular velocity rotating on the local X axis. Has no effect ifControllerBase.RigidityEnabledis true.RollMaxTorque
: floatThe maximum torque applied to rotate to the desired roll.The maximum torque applied to rotate on the local Z axis to the desired roll orientation. Has no effect if
ControllerBase.RigidityEnabledis true.RollSpeedFactor
: floatMultiplied byControllerManager.BaseTurnSpeedto determine the maximum angular velocity for roll.Multiplied by
ControllerManager.BaseTurnSpeedto determine the maximum angular velocity rotating on the local Z axis. Has no effect ifControllerBase.RigidityEnabledis true.
SwimController also has every member of ControllerBase. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.