Hit actor in line trace isn't equaling itself even though it is-

so I have a line trace for my gun shooting, which is how it tracks when it hit the enemy. im doing a test to see if the hit actor = enemy, and it always returns false. I decided to put in my string the name of the hit actor (plugging display name of it into the pink thing) and it says the enemys name. Whats going on here? anything im missing?

You’re probably doing this:


If you are, that’s wrong because you’re comparing an actor to a blueprint asset.

What you need to do is either cast it to an enemy or check to see if it is a child class of enemy:

yoooo it works now I can deal damage, thank you so much.

1 Like