(Beginner)
I watched a video about dialogue boxes and used a part of the code from it but it doesn't seem to be working for me.
Like, the dialogue scene (Text.tscn) works fine by itself but while trying to call it from a different scene using my NPC, it doesn't work.
I can't seem to find the problem.
Thanks for the help!
extends Area2D
var active = false
const Dialog = preload("res://scenees/Text.tscn")
func _process(delta):
$Ping.visible = active
$Label.visible = active
func _on_NPC_body_entered(body):
if body.name == 'Player':
active = true
func _on_NPC_body_exited(body):
if body.name == 'Player':
active = false
func _input(event):
if Input.is_action_just_pressed("Interact") and active == true:
print("ehyyyyyyyyyyyyyy")
#Just checking if it works. As of now, it prints but doesn't call an instance of the scene
$Label.visible = false
$Ping.visible = false
#should be calling the Text scene but its not
var dialog = Dialog.instance()
get_parent().add_child(dialog)`