Event hit and hit result

Hi everyone,

Kinda new to unreal engine and there’s something I don’t understand. I have a bullet that is going to hit a moving enemy, so I use the Event hit and do a quick check to see if the actor is child of Enemy class. It was working well until I made the enemy moves, the bullet was hitting the enemy, but not dealing any damage to it. So I did some checks and finaly I found out that the Hit Actor, of the Break Hit Result, was refering to my bullet when the enemy is moving , which doesn’t make any sense to me. So basicaly, in my Bullet Blueprint, I have an Event Hit, that I use Break Hit Result on the Hit parameters, that is saying that the Hit Actor, is my bullet. Like it’d it itself on the moving enemy.

So I just tried using the Other (actor reference) parameters, which is directly on the Event Hit in my Bullet Blueprint, because from what I understand it’s ALSO the actor the Event Hit is colliding with, and it worked. But I don’t understand why. I thought that both Actors would be the same but it’s not and I may be searching wrong but I’m not finding the answer looking for. I might encounter a similar problem in the future so I’d like to understand how it really works.

Thanks a lot !

In your Event Hit on your Bullet should be checking if the Hit Actor can take damage, if it can you apply damage, that should be all the Bullet does. For simple damage you shouldnt need the Hit Result, the node itself returns an Other value that contains the Actor reference that was just impacted.

Then on your actor that can take damage you should have an Event Any Damage, this is where you apply the whatever effect you want to occur to this Actor when it takes damage, like reducing its health for example.

Thanks for the quick answer, it’s easier than I thought. The last thing I’d like to know is, whats the difference between the ‘Other’ actor that you’re using, and the ‘Hit Actor’ of the breaking result? I get that I don’t need it, I just want to know how they differ, for a good understanding

I believe they are the same, though the Hit Result could possibly return itself as the Actor, not 100% sure.

You can always check if they equal each other if you needed to.

Well pretty much what I thought, just don’t get why Hit Actor would return itself , seems like that what’s happening to me. Anyway I’ll keep using Other. Thanks !

if oyu havent https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseOnHit/Blueprints/index.html also I remember that if you launch/cast for collision of actors from a certain place for example in your character, it could return itself, because the collider is a component of “yourself” or the character… not the pawn, and I also remember that to this cast/scan you can pass a list of objects or classes (dont remember) to which ignore, so you dont return yourself.