diff --git a/scenes/player/player.gd b/scenes/player/player.gd index 96aefc2..d9535d3 100644 --- a/scenes/player/player.gd +++ b/scenes/player/player.gd @@ -16,6 +16,7 @@ func _ready() -> void: assert(id == 1 or id == 2, "id ("+str(id)+") is invalid") anim_dir = 'up' if id == 1 else 'down' def_dir = 'up' if id == 1 else 'down' + hit_timer.connect("timeout", $StateMachine/Hitting._on_hit_end) func get_movement_vector() -> Vector2: var x_mov: float = Input.get_action_strength('p'+str(id)+'_move_right') - Input.get_action_strength('p'+str(id)+'_move_left') diff --git a/scenes/player/states/hitting.gd b/scenes/player/states/hitting.gd index 7cf0f17..f5c173d 100644 --- a/scenes/player/states/hitting.gd +++ b/scenes/player/states/hitting.gd @@ -42,8 +42,8 @@ func _enter(_previous_state_path: String, _data: Dictionary = {}) -> void: ) hit_node_ref = weakref(hit_node) - - player.hit_timer.timeout.connect(_on_hit_end) + + # cooldown player.hit_timer.start() func _on_hit_end() -> void: