Recoil overcompensation fix
This commit is contained in:
parent
5a3fc03748
commit
1ccc833b1a
2 changed files with 5 additions and 3 deletions
|
|
@ -135,7 +135,7 @@ cull_mask = 1048573
|
|||
fov = 90.0
|
||||
script = ExtResource("3_qhqgy")
|
||||
compensation_time = 0.1
|
||||
compensation_delay = 0.1
|
||||
compensation_delay = 0.2
|
||||
|
||||
[node name="molikman_hands" parent="Camera3D" instance=ExtResource("4_dqkch")]
|
||||
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, -1, 0)
|
||||
|
|
|
|||
|
|
@ -42,6 +42,9 @@ func rotate_camera(x,y) -> void:
|
|||
rotation.x = clamp(rotation.x + y,-PI/2,PI/2)
|
||||
orthonormalize()
|
||||
if sign(vertical_compensation) == sign(y):
|
||||
if abs(vertical_compensation) - abs(y) < 0:
|
||||
vertical_compensation = 0
|
||||
else:
|
||||
vertical_compensation -= y
|
||||
|
||||
func recoil(x,y) -> void:
|
||||
|
|
@ -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