0 votes

In this code:

extends Spatial

var cilindro = preload("res://Cilindro.tscn")
var c = cilindro.instance()

func _ready():
    var g = $Grupo_Cilindros
    print (g.get_children())

I get the result: [[RigidBody:1133]]

Changing the 'add_child' line to g.add_child(c, true) I also get [[RigidBody:1133]].

What am I missing?

in Engine by (57 points)

1 Answer

+1 vote
Best answer

[[RigidBody:1133]] is not a name, it's a reference.
try print(c.name) to see if it works.

by (9,768 points)
selected by
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.