So im making a pretty simple shooting game with multiple enemy types.
To apply damage they all have a tag (“Enemy”)
In the projectile blueprint its pretty simple "event hit’ > actor has tag “Enemy” > branch, if true > destroy actor (enemy)
But when testing, sometimes when killing the enemies, a random different enemy would be destroyed rather than the one hit by the projectile
This got me thinking, are you using the Get All Actors of Class node for that by any chance? Make sure to use the Other pin of the Event Hit node like this:
What vis mentioned would definitely be the best way I can think of to accomplish, getting all actors, if this is your case is likely the problem. One thing I’ve seen a lot of on here is devs having issues with the gameplay tags, especially in build version of their games. I don’t use them so I can’t speak on them from experience. In my opinion, while tags are pretty lightweight and efficient, it’s still another query that has to execute on event. I think setting up projectile and enemy collision channels, and using the above functionality would be the optimal and more reliable way to accomplish what your wanting to do. The only issue with vis recommendation being that if a projectile hits an actor that maybe you don’t want to be destroyed, say like a functioning door or friendly NPC, they’d be destroyed as well. That’s where I tend to prefer custom collision channels