Skip to content

Commit

Permalink
Merge pull request #6 from ARPGLTD/FixJoyStickEvents
Browse files Browse the repository at this point in the history
Fix null check guard typos
  • Loading branch information
Phazorknight authored Jan 1, 2024
2 parents 91234d5 + 18a8efc commit 7d78b72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions COGITO/Scripts/player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,15 @@ func _physics_process(delta):
carryable_position.rotation.z = lerp_angle(carryable_position.rotation.z, $Neck/Head.rotation.x, 5 * delta)

# Processing analog stick mouselook
if joystick_v_event and !is_movement_paused:
if joystick_h_event and !is_movement_paused:
if abs(joystick_h_event.get_axis_value()) > JOY_DEADZONE:
if INVERT_Y_AXIS:
$Neck/Head.rotate_x(deg_to_rad(joystick_h_event.get_axis_value() * JOY_H_SENS))
else:
$Neck/Head.rotate_x(-deg_to_rad(joystick_h_event.get_axis_value() * JOY_H_SENS))
$Neck/Head.rotation.x = clamp($Neck/Head.rotation.x, deg_to_rad(-90), deg_to_rad(90))

if joystick_h_event and !is_movement_paused:
if joystick_v_event and !is_movement_paused:
if abs(joystick_v_event.get_axis_value()) > JOY_DEADZONE:
$Neck.rotate_y(deg_to_rad(-joystick_v_event.get_axis_value() * JOY_V_SENS))
$Neck.rotation.y = clamp($Neck.rotation.y, deg_to_rad(-120), deg_to_rad(120))
Expand Down

0 comments on commit 7d78b72

Please sign in to comment.