#Instanced Nodes Getting Named As @Area2D@1 instead of @Enemy@1

7 messages · Page 1 of 1 (latest)

daring tide
#

Hey there, newbie here so I apologize if this is a stupid question. I'm instancing multiple enemies from an enemy scene and even though I renamed the scene to Enemy and saved it under that name, every time a new instance is formed, I see in the remote that it is being renamed as @Area2D@1, 2, 3 and so on.

Consider me OCD I really need to fix this before I go further, please help me. Thank you!

#

To better iterate, the expected result I wanted to see was the duplicate instances being renamed as something like "@Enemy@1"

daring tide
#

Upon further research, this is apparently the default behavior on Godot 4.0. Is there a setting I can change to bring this back?

marble shoal
#

if you open your enemy.tscn in a separate tab, what is the name of the root node in there? (in the Scene tree view)

daring tide
ionic burrow
#

It shouldn't matter what the node name is. If you really want to you can name them yourself when adding to the tree

ebon mortar
#

If you really want name them after their original scene. There is a second parameter to add_child that you can pass a true through, eg. add_child(instance, true) that will give them names with ascending numbers. Just know that this was changed back idk when but its done this way because it allows faster referencing of nodes and is more performant.