Hey, y'all! I was following this tutorial, but I've run into an issue.
https://www.youtube.com/watch?v=UhPFk8FSbd8
My inputs are all handled in physics_process, not unhandled_input like the tutorial. However, I don't want to change that. The player can move around once they've opened dialogue, which is fine with me, but I want the dialogue to close when the dialogue_interaction_finder (player's area2d) is no longer colliding with the NPC's dialogue area2d. How could I have it stop when they're no longer colliding?
here's what the code looks like in my player.gd:
if Input.is_action_just_pressed("interact"):
#Makes it so that something only happens if the collision shapes are overlapping
var actionables = dialogue_interaction_finder.get_overlapping_areas()
if actionables.size() > 0:
actionables[0].action()
return```
and in the dialogue_area:
```extends Area2D
@export var dialogue_resource: DialogueResource
#variable to choose the start of the dialogue
@export var dialogue_start: String = "this_is_a_node_title"
func action() -> void:
DialogueManager.show_example_dialogue_balloon(dialogue_resource, dialogue_start)```
If you're relatively new to Godot (or just Godot 4) and want to set up branching dialogue then grab a copy of the repository below and follow along with this tutorial.
Starting project: https://github.com/nathanhoad/beginner_godot4_dialogue
Become a patron today: https://patreon.com/nathanhoad
0:00 Intro
0:35 Installing Dialogue Manager
2:51 ...