why collider queue_free(), sometime work , sometime didn't work?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By potatobanana

when my bullet collide with enemy, sometime it will queue_free() sometime it just push it back, why it happen like that? what i did wrong? i try collider.is_in_group(“”), still give same result
this video show what happen. https://youtu.be/ZIlJpOxmkho

this project file https://drive.google.com/open?id=1UsMfh-GccUhDHUI0BoJyCH1fdvDvVkNG

this mob/enemy
enter image description here

this bullet
enter image description here

:bust_in_silhouette: Reply From: potatobanana

solve just put in is_in_group(), i dont know why did’t work before.

Imagine a tree like this:

 - World
   - Bullet
   - Bullet
   - Bullet

The name of a node has to be unique, at least for the layer of the scene tree it’s on. Otherwise getting nodes via their path wouldn’t work anymore.

In order to ensure this, Godot will automatically change the names of nodes instanced from the same scene. So actually a real tree would look like this:

 - World
   - Bullet
   - @Bullet@2
   - @Bullet@3

TL;DR: checking nodes by name is very error prone and not recommended!

njamster | 2020-03-19 15:02

thanks , and welcome back

potatobanana | 2020-03-19 15:45