0 votes

I wanted to add an Interaction with a bed to try out the Dialogic plugin. Everything kinda works but the dialog only showes up ones after pressing "interact" and then never again.
I get the error Message "addchild: Parameter "pchild" is null." everytime i try to "interact" again.

This is my Code for the Area 2D

extends Area2D

var Bed1_dialog = Dialogic.start('Bed')
var Interactable=false
func _on_NPC_body_entered(body: PhysicsBody2D):
    Interactable = true

func Interact():
    if Input.is_action_just_pressed("interact") and Interactable == true:
        add_child(Bed1_dialog)

func _process(delta):
    Interact()
Godot version 3.5.1
in Engine by (12 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.