Invalid set index 'paused' (on base: 'null instance') with value of type 'bool'.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By gummyrat
    extends Area2D
export var door = "name"

func _ready():
	add_to_group("door")
	
func open_door_request_dialog():
	var dialog = Dialogic.start(door)
	dialog.pause_mode = PAUSE_MODE_PROCESS
	Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
	dialog.connect('timeline_end', self, 'end_dialog')
	get_tree().paused = true


func end_dialog(_data):     
	get_tree().paused = false
	Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)

Using dialogic to add dialogue in my game but am currently having trouble with having an area (player) entering another area (the door) to start the dialog.

Before this i had:

    func open_door_request_dialog():
    	var dialog = Dialogic.start(door)
    	dialog.pause_mode = PAUSE_MODE_PROCESS
    	Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
            get_parent().add_child(dialog)
    	dialog.connect('timeline_end', self, 'end_dialog')
    	get_tree().paused = true

In which I got back Attempt to call function ‘add_child’ in base ‘null instance’ on a null instance.

I thought removing it would help but instead I was bestowed this next error.

:bust_in_silhouette: Reply From: Inces

The thing is your Node isn’t in Scene tree itself. He has no parent and he can’t refer scene_tree. This script, that extends Area2D, it needs to be childed to anything in the scene. You propably instance it somewhere and forget to child it.