diff --git a/characters/base/character.gd b/characters/base/character.gd index c8635f9..b5de4f1 100644 --- a/characters/base/character.gd +++ b/characters/base/character.gd @@ -184,6 +184,8 @@ var jump_impetus := false var action1_impetus := false ## Whether the character is "trying" to perform their secondary action. var action2_impetus := false +## Whether the character is "trying" to perform a tertiary interaction. +var interact_impetus := false ## Collision shape height. var height: float: get(): @@ -1242,7 +1244,7 @@ func _on_idle_while_holding_state_tick(delta: float) -> void: force_change_state(&'jump-while-holding') elif !impetus.is_zero_approx(): state = &'walk-while-holding' - elif action1_impetus || action2_impetus: + elif action1_impetus || action2_impetus || interact_impetus: state = &'put-down' func _on_walk_while_holding_state_tick(delta: float) -> void: @@ -1258,6 +1260,8 @@ func _on_walk_while_holding_state_tick(delta: float) -> void: state = &'run-while-holding' elif impetus.is_zero_approx() && top_speed_proximity < 0.03125: state = &'idle-while-holding' + elif action1_impetus || action2_impetus || interact_impetus: + state = &'put-down' func _on_run_while_holding_state_tick(delta: float) -> void: _do_standard_motion(delta) diff --git a/characters/controllers/player_character_controller.gd b/characters/controllers/player_character_controller.gd index 9aaae34..599393d 100644 --- a/characters/controllers/player_character_controller.gd +++ b/characters/controllers/player_character_controller.gd @@ -15,3 +15,4 @@ func _physics_process(_delta: float) -> void: character.jump_impetus = Input.is_action_pressed(&'jump') character.action1_impetus = Input.is_action_pressed(&'action1') character.action2_impetus = Input.is_action_pressed(&'action2') + character.interact_impetus = Input.is_action_pressed(&'interact') diff --git a/test/pick_up_item.gd b/test/pick_up_item.gd index 43bdb29..1ef3249 100644 --- a/test/pick_up_item.gd +++ b/test/pick_up_item.gd @@ -5,5 +5,5 @@ func _ready() -> void: func _on_body_entered(body: PhysicsBody3D) -> void: if body is Character: - if body.action2_impetus: + if body.interact_impetus: body.pick_up(self)