clamp again

This commit is contained in:
Chris Bell 2024-12-28 22:09:29 -06:00
parent c3285652ea
commit b003aec5a4

View File

@ -74,10 +74,9 @@ func handle_input(_delta: float):
# Apply torque for turning
if turn_input != 0:
var torque = Vector3.UP * turn_input * base_turn_speed
var clamped_torque = Vector3(
torque.x.clamp(-max_turn_speed, max_turn_speed),
torque.y.clamp(-max_turn_speed, max_turn_speed),
torque.z.clamp(-max_turn_speed, max_turn_speed))
# Clamp the torque to the maximum turn speed
var clamped_torque = clamp(torque, Vector3(-max_turn_speed, -max_turn_speed, -max_turn_speed), Vector3(max_turn_speed, max_turn_speed, max_turn_speed))
apply_torque(clamped_torque)