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 

I tried fixing that code formatting in your post, but it seems the indentation was all flattened when you copy-pasted. Might want to look that over and fix it.

    Megalomaniak pretend that the indentation is correct. I have to hand type it on my phone because my production station doesn't connect to WiFi. What is missing from the code ? Thanks

    In GDScript indentation is important though, depending on indentation a line of code could be in the correct place or outside of the function or logic loop that it should be in.

    As for what might be missing, I'm not really sure since I haven't invested time in using dialogic myself before. So I'm not too keen on making guesses.

    I know indentation matters. The indentation is correct. Again, I don't have WiFi on my production station, so I hand typed it.

    I don't understand why you would bother answering just to contribute nothing

    Can someone helpful please respond? Thanks

    Im not sure how to write it so the space bar only makes the state true outside of the range of the character. Once I enter the range, it always states as true after the fact. I just want it to happen once