0 votes

In this code:

extends Spatial

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

func _ready():
    var g = $Grupo_Cilindros
    g.add_child(c) 
    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?

asked Mar 7, 2019 in Engine by rogeriodec (55 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.

answered Mar 7, 2019 by volzhs (9,464 points)
selected Mar 7, 2019 by rogeriodec
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 How to use this Q&A? before posting your first questions.