Godot v4.3
Replace this line with your Godot version
I keep getting crashed, and get the error Missign Node on one of my scenes. I’ve just fixed this by remaking the scene from the other scenes it contained, as they are still working.
The last time I had this happen I suddenly got a new Error in the script for my NPC. The error says: Invalid assignment of property or key ‘interact’ with value of ‘Callable’ on a base object of type ‘null instance’.
I don’t know why this suddenly became an error, as it was working fine before the crash. I am completely new to this, so would appreciate any help.
This is my code for reference.
extends Node2D
var resource = load("res://dialogue_resource")
var talk = 0
var dialogs = 0
@onready var interaction_area: InteractionArea = $InteractionArea
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
interaction_area.interact = Callable(self, "_on_interact")
func action() -> void:
pass
func _on_interact():
if talk == 0 and dialogs == 0:
dialogs = 1
print(dialogs)
DialogueManager.show_example_dialogue_balloon(load("res://dialogs/Test.dialogue"), "start")
DialogueManager.dialogue_ended
func _on_canvas_layer_writing() -> void:
print("hei")
talk = 1
func _on_canvas_layer_not_writing() -> void:
talk = 0