When i shoot the rocket it prints “Enemy” for the first one, but the rest of the instances read “@Area2D@2”, “@Area2D@3”, and so on, but in the course after the first “Enemy” they read “@Enemy@2”, “@Enemy@3”, etc…
The name of my enemy scene is “Enemy” so i’m not sure how they get their name. Will something break?
In the scene tree, siblings cannot have the same name (ie a parent and child could have the same name, as can nodes at the same level of depth but with different parents. Siblings, specifically, cannot). What you’re seeing is Godot giving these newly-spawned enemies some “nonsense” names (not truly nonsense because they’re procedural, but you know what I mean) because the name “Enemy” is already taken by your first instance.
This is normal behaviour when you don’t include code to change the names of your instances, but there are two things to keep in mind:
It’s always a good practice to set the names of your instances in code if there will be more than one, as it future-proofs your code regarding the second point below. I did something like this:
If you do any conditional checking based on the name of an instance, then you definitely need something like this for obvious reasons. I think Kaan actually does do some name-based checks in this game, and if that’s the case, you will definitely need to make this change for those conditions to work.
Thanks a bunch for the response! that makes sense. I tested it and it works great. I’m still wondering why in the video they read “@Enemy” instead of the “@Area2D” I got, but this seems to be a very minor thing I think, so thanks again!