Godot Version
4.2.2
Question
Hello!
I’m new in Godot and I found something strange. I have done Dodge the Creeps! in 2D and I tried to customize it.
When I print body.name, sometimes it shows “Mob”, sometimes “@Rigidbody2D@X”. Is it normal and how can I test if I hit a mob or someting else?

A name like @Rigidbody2D@X
is auto-generated, because that node is instantiated from a scene, instead of created manually in the editor.
If you’re instantiating mobs by code, the first mob will be named Mob, but from then on you’ll get an autogenerated name.
You can still force the name when you create it, but Godot will automatically rename them as Mob2, Mob3, Mob4… Just do this every time you instantiate a mob (assign the name after you add_child the mob):
var mob = MOB_SCENE.instantiate()
add_child(mob)
mob.name = "Mob"