Change dismount button and fix dodging on dismount

This commit is contained in:
TheThomaas 2026-10-12 14:28:49 +02:00
parent 00bfe60c32
commit 5e89c73c31

View file

@ -45,7 +45,7 @@ func _ready() -> void:
InputMap.action_add_event(mount_action, key))
_ensure_action(dismount_action, func():
var pad := InputEventJoypadButton.new()
pad.button_index = JOY_BUTTON_Y
pad.button_index = JOY_BUTTON_X
InputMap.action_add_event(dismount_action, pad)
var key := InputEventKey.new()
key.physical_keycode = KEY_F
@ -151,8 +151,7 @@ func dismount() -> void:
player.is_mounted = false
player.exit_mount_stats()
for state_name in blocked_states:
state_machine.set_state_blocked(state_name, false)
_release_blocked_states_next_frame()
visual_root.position -= _seat_applied
_seat_applied = Vector3.ZERO
@ -169,3 +168,11 @@ func _swallow_jump_this_frame() -> void:
state_machine.set_state_blocked("JumpState", true)
await get_tree().physics_frame
state_machine.set_state_blocked("JumpState", false)
func _release_blocked_states_next_frame() -> void:
#Dodge/Crouch restent refuses pendant la frame de la descente : si la touche de descente est aussi celle de la roulade,
#le meme appui ne declenche pas de roulade une fois descendu
await get_tree().physics_frame
if mount != null: return #on est remonte entre-temps : les etats restent bloques
for state_name in blocked_states:
state_machine.set_state_blocked(state_name, false)