0 votes

I have a problem with this. I'm new here. I just wanted to make a pause screen and then I got a problem with addchild. It doesn't work, but getparent().remove_child(self) works. It successfully removed the child.

Pause script:

func _process():
    if Input.is_action_just_pressed("ui_accept"):
        var options = load("res://options.tscn").instance()
Godot version 3.4
in Engine by (20 points)

1 Answer

+1 vote
Best answer


Make the following changes to the line where you want to add a child node:


I hope it will help you. Good luck!

by (97 points)
selected by

I got this error

Attempt to call function 'add_child' in base 'null instance' on a null instance.

Nevermind, it worked :)

I just had to do it like this:


Great job!


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.