Recoil overcompensation fix
This commit is contained in:
parent
5a3fc03748
commit
1ccc833b1a
2 changed files with 5 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue