what does this “stop_bullets" signal do? After an enemy is destroyed, you appear to be emitting this signal every frame. I presume that it stops bullets, and I don’t see a way this would be able to discriminate between bullets fired by different tanks (granted, you haven’t shared the stop bullets code, so it might be there.)
If the reason you’re trying to stop bullets is to avoid things getting hit after they’ve been destroyed, wouldn’t it make more sense to have each tank toggle their colliders after they detect a bullet collision? That way you don’t need to mess around with figuring out how to make your stop_bullets code only target the bullets from specific tanks.
Something like this:
extends CharacterBody2D
var bullet_collision_layer : int = 1 #set this to the value of whatever collision layer your bullets use
func _physics_process(delta: float) -> void:
move_and_slide()
for i in get_slide_collision_count():
var collision = get_slide_collision(i)
if collision.get_collider():
if collision.get_collider().name == "bullet": #change this to the name you use for your bullets, if it's different.
set_collision_layer_value(bullet_collision_layer, false)
set_collision_mask_value(bullet_collision_layer, false)
visible = false
#insert toggle off for firing bullets here
(be warned, I have not tested this code, I pulled it from this thread and modified it to purpose)