Why does this happen?

I did a function for when a missile hits me, I get an invincibility shield for 1 second for balance

. I want to copy what I did with the missile, but other normal bullets. so after cast to missile, I did cast to tankbullets23 (name of those bullets). but when I do that and play the game, I don’t get shield either for the tank bullets23 or for the missile. why is that? and how can I change it so I get shield for both like I did for the missile.

Is TankBullet23 a child class of Missiles? If not then just remove the cast to Missiles.

Wow thank you man this really helped I didn’t think of that theory

Because you are casting to Missle first and then Bullets straight after.

Imagine the Missle hits you so the missle cast is successful it then moves on to find out if the the bullet cast is successful (Which it isn’t cause a missle hit you not bullets) So it stops executing the rest of the code.

And vice versa.

If the bullets hits you its never going to cast to Bullets because it failed the Missle cast first.

Add a sequence node in there after the event. So you can check both and execute the same code based on what hit you.

Try that for now.

No problem, also make sure in your Missle and Bullet BP that the right collision is enabled that it does trigger the OnComponentHit event.