Instanced Node is Not Appearing

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By aagoldberg

I’ve instanced a built_in RichTextLabel node, yet it fails to physically appear in the editor. I’ve also checked If the parent has the instanced node, and it returns True, so I’m stumped as to what the solution is.

Can you share us some code or what you’ve done?

p7f | 2019-01-04 02:05

:bust_in_silhouette: Reply From: lavaduder

Okay this is a really generic question, but I’ll give it a shot.

Have you added the child to the scene

func my_func():
    var myfile = load("myscene.tscn").instance()
    add_child(myfile)

if soo then does it have text? Because it may seem invisible to you.

func my_func():
    var myfile = load("myscene.tscn").instance()
    myfile.set_text("TESTING")
    add_child(myfile)

Perhaps your trying to instance a new() object. You don’t need to instance that. Just add it to the scene.

func my_func():
    var richtext = RichTextLabel.new()
    add_child(richtext)