I have a hit box set up for when the hit box gets hit a bullet “BP_Bullet_Green” it breaks and that works.
But I have multiple different types of bullets such as “BP_Bullet_Blue” that I also want to effect the hit box in the same way.
I have a hit box set up for when the hit box gets hit a bullet “BP_Bullet_Green” it breaks and that works.
But I have multiple different types of bullets such as “BP_Bullet_Blue” that I also want to effect the hit box in the same way.
Hi, I would say this is not the best approach.
I suggest you use Interface. When the Bullet_Blue, Bullet_Green, Bullet_any Hit an Actor, it will send an interface call to that actor with some data.
For example in my case when the bullet hits an enemy it calls interface method damage and passes hit result and damage as float. So the different bullets will have different damage, therefore I do not need to cast, and the interface implementation will pass the damage I need.
Also, it is safer as in case the actor is marked as removed, the interface call will be ignored, but cast on the acter that is marked removed will crash the game.
Think about it and if you need more details, let me know.
BR