Hey there, so I'm using Dialogic to have a dialogue system with an NPC character. I'm following some tutorials online. When it starts, everything is fine. Once the character approaches the NPC, after the dialogue box closes, it keeps reopening whenever I press space bar anywhere else in the game.
Thanks in advanced. Very smart people here
Here's the code for the npc
extends Area2D
var active = false
func _ready():
connect("body_entered", self, '_on_NPC_body_entered')
connect("body_exited", self, 'on_NPC_body_exited')
func _process(delta):
$Exclamation.visible = active
func _input(event):
if get_node_or_null('DialogNode') == null:
if event.is_action_pressed("ui_accept") and active:
get_tree().paused = true
var dialog = Dialogic.start('conversation')
dialog.pause_mode = Node.PAUSE_MODE_PROCESS
dialog.connect('timeline_end', self, 'unpause')
add_child(dialog)
func unpause(conversation):
get_tree().paused = false
func _on_NPC_body_entered(body):
if body.name == 'Player':
active = true
func _on_NPC_body_exited(body):
if body.name == 'Player':
active = false