add ability to move camera slower on controller
This commit is contained in:
parent
0652e0d23b
commit
8c5cf83803
@ -141,6 +141,11 @@ run={
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":7,"pressure":0.0,"pressed":true,"script":null)
|
||||
]
|
||||
}
|
||||
look_slow={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":8,"pressure":0.0,"pressed":true,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[layer_names]
|
||||
|
||||
|
||||
@ -99,20 +99,24 @@ func _process_controller_rotating(delta: float) -> void:
|
||||
)
|
||||
)
|
||||
|
||||
var look_slow: float = 0.25 if Input.is_action_pressed("look_slow") else 1.0
|
||||
|
||||
rotate_y(
|
||||
(
|
||||
-controller_raw_input.x
|
||||
* deg_to_rad(Settings.controller_sensitivity_horizontal)
|
||||
* look_slow
|
||||
* delta
|
||||
* (-1 if Settings.invert_controller_horizontal else 1)
|
||||
* (-1.0 if Settings.invert_controller_horizontal else 1.0)
|
||||
)
|
||||
)
|
||||
_camera.rotate_x(
|
||||
(
|
||||
-controller_raw_input.y
|
||||
* deg_to_rad(Settings.controller_sensitivity_vertical)
|
||||
* look_slow
|
||||
* delta
|
||||
* (-1 if Settings.invert_controller_vertical else 1)
|
||||
* (-1.0 if Settings.invert_controller_vertical else 1.0)
|
||||
)
|
||||
)
|
||||
_camera.rotation.x = clampf(_camera.rotation.x, PI / -2, PI / 2)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user