r/godot•
Ninjawarrior2077

Back again with another Dialogue manager question

help me

My script for an interactible window is this:

extends Area2D

onready var player: CharacterBody2D = %Player

var player_in_range = false

var can_interact = true

func _process(_delta: float) -> void:

**if player\_in\_range == true:**

	**if Input.is\_action\_just\_pressed("Interact") and can\_interact == true:**

		**can\_interact = false**

		**DialogueManager.show\_example\_dialogue\_balloon(load("res://Dialogue/Window\_desc.dialogue"), "start")**

		**await DialogueManager.dialogue\_ended**

		**await get\_tree().create\_timer(0.5).timeout**

		**can\_interact = true**

func _on_body_entered(body: Node2D) -> void:

**if body is CharacterBody2D:**

	**player\_in\_range = true**

	**can\_interact = true**	

func _on_body_exited(body: Node2D) -> void:

**if body is CharacterBody2D:**

	**player\_in\_range = false**

I can start interacting with it with z and enter, but how do I make it progress while pressing z and enter only?
(z does not work for progressing lines right now, enter and space do)

Posted Aug 1, 2025, 12:10 PM UTC

13
Loading comments…