Recoil overcompensation fix

This commit is contained in:
Rendo 2025-11-26 19:32:53 +05:00
commit 1ccc833b1a
2 changed files with 5 additions and 3 deletions

View file

@ -42,7 +42,10 @@ func rotate_camera(x,y) -> void:
rotation.x = clamp(rotation.x + y,-PI/2,PI/2)
orthonormalize()
if sign(vertical_compensation) == sign(y):
vertical_compensation -= y
if abs(vertical_compensation) - abs(y) < 0:
vertical_compensation = 0
else:
vertical_compensation -= y
func recoil(x,y) -> void:
rotate_camera(x,y)
@ -55,5 +58,4 @@ func recoil(x,y) -> void:
func start_compensating() -> void:
compensate = true
print(vertical_compensation)
compensation_speed = vertical_compensation / compensation_time