add deadzone setting
This commit is contained in:
parent
e73e2e9e06
commit
fc5ab58571
@ -64,18 +64,10 @@ const CONFIG_PATH := "user://settings.cfg"
|
||||
|
||||
@export_group("Controls")
|
||||
@export_subgroup("KB & Mouse")
|
||||
## rotation speed in degrees per pixel
|
||||
@export var mouse_sensitivity: float = 0.5
|
||||
@export var invert_mouse_horizontal: bool = false
|
||||
@export var invert_mouse_vertical: bool = false
|
||||
|
||||
@export_subgroup("Controller")
|
||||
## horizontal rotation speed in degrees per second
|
||||
@export var controller_sensitivity_horizontal: float = 270
|
||||
## vertical rotation speed in degrees per second
|
||||
@export var controller_sensitivity_vertical: float = 120
|
||||
@export var invert_controller_horizontal: bool = false
|
||||
@export var invert_controller_vertical: bool = false
|
||||
@export var movement_stick_deadzone: float = 0.5
|
||||
@export var aiming_stick_deadzone: float = 0.5
|
||||
|
||||
var _default_values: Dictionary = {}
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ func controller_aiming(move_input: Vector2) -> void:
|
||||
aim_input = Input.get_vector("aim_left", "aim_right", "aim_up", "aim_down")
|
||||
else:
|
||||
aim_input = Inputer.get_vector_from_raw_strengths(
|
||||
_aim_left, _aim_right, _aim_up, _aim_down
|
||||
_aim_left, _aim_right, _aim_up, _aim_down, Settings.aiming_stick_deadzone
|
||||
)
|
||||
|
||||
if aim_input.length() == 0 and move_input.length() == 0:
|
||||
|
||||
@ -67,7 +67,11 @@ func _lateral_movement(velocity: Vector3, delta: float, can_move: bool) -> Vecto
|
||||
move_input = Input.get_vector("move_left", "move_right", "move_up", "move_down")
|
||||
else:
|
||||
move_input = Inputer.get_vector_from_raw_strengths(
|
||||
_move_left, _move_right, _move_up, _move_down
|
||||
_move_left,
|
||||
_move_right,
|
||||
_move_up,
|
||||
_move_down,
|
||||
Settings.movement_stick_deadzone
|
||||
)
|
||||
Debugger.text("move_input" + str(get_instance_id()), move_input)
|
||||
|
||||
@ -95,6 +99,3 @@ func _vertical_movement(velocity: Vector3, delta: float, is_on_floor: bool) -> V
|
||||
velocity.y = 0
|
||||
|
||||
return velocity
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user