Godot Version
4.5.1
Question
Hi,
I am programming a 2D top-down game with vehicles that can shoot. I have my first enemy ready and want so other enemies obstruct the projectile path from the shooter to the player.
When I set the projectile collision mask to scan for the enemy it instantly disappears as it detects the shooter. Is there a way for the projectile to recognize the shooter and not collide with it but other enemies with the same collision setup? I don´t want to use time delays or spawn the projectile in front of the shooter as it kinda feels inconsistent and doesn´t look that good when the projectile appears out of thin air.
Also maybe combine this with the player detection so other enemies obstruct the visibility and the enemies behind stop shooting?
Enemy Node:
Maybe I can work with get_parent(). But I don´t understand how I can make the projectile that is spawned by the LMG that is a child of multiple parents recognize the top-most Bandit Node.
Projectile script:
LMG script:
Maybe someone can also make improvements to the damage calculation? I used a GlobalScript so the Player knows how much damage he receives and backwards, but I don´t know if this may become a problem in the future when there are multiple weapons with different damage numbers.
For example there is a big slow hitter that sets the damage to -100 but at the same time multipe small projectiles collide and deal the same damage. Not an issue yet but maybe someone already experienced this?


