Help Casting To Hit Actor?

Hi, I have a capsule trace that gets the hit actor and I would like to make a function that gets that hit actor then casts to that actor which then calls an event from that actor.

Here is what I have so far but doesn’t seem to work.

283464-delete.png

The idea was since I have numerous character bp’s that would get hit I wanted to create a function that checks for the actor hit and cast to that actor.

The editor tells me the self object reference is not compatible with the bp’s object reference. Any idea how to do this properly or better?

Any help would be appreciated thank you!

I need to see more of the logic pal Show me the blueprints from where the trace begins.

Since you have many different BP’s casting is not the best solution. You want to use a Blueprint Interface instead. Epic has made a 2h+ tutorial about this. It will explain you everything.

The Damage only works on an Eva Unit 05 BP. You have joined it up to a Cast node that will produce an Eva Unit 00 BP, which is incompatible. Given the error is also on the cast node, I’m guessing the Check Hit is expecting a 05 BP object.

You either need to write Damage function for a 00 Unit, or Cast to a 05 Unit (if it is compatible). As it stands, I would replace the Cast to 00 node with a Cast to 05 node.

Yeah its expecting 05 since its the blueprint that I’m working on but if I cast to 05 it would be checking damage against itself and that’s not really what I need.

From the capsule trace I’m able to get the actor that was hit, but after that I’m unable to cast to that actor using that variable and call the event for that specific bp.

I have an event for all the blueprints that triggers the damage logic in it but not sure how to call that event when a hit is triggered from each characters bp.

Thank you for the help so far.

I have anim notifys that open/close the gate that triggers the capsule trace, the col spawn is just a blank object so I can change where the capsule trace spawns easier.

everything works up to the point where my function is called.

I’ve used blueprint interfaces a little before, but I’ll look into this maybe I’m missing something thank you.

I’m assuming I would pull references to the hit actor from the bpi? and then use that to trigger the event. Just trying to get a solid idea before I get into this.

“Its expecting 05 since its the blueprint that I’m working on”. It doesn’t need to be the blueprint you’re working on. If the actor that was hit was 00, then you need to Cast to 00.

If that’s not right, I might need a little more info on how the 05 and 00 BPs relate to each other.

I worded it wrong I should have specified that that functions target was “self” which is why it did not accept me casting to another blueprint other then itself, in this case it being 05.

I’m assuming this is a problem with my function instead of the blueprint interaction itself so yeah you’re right.

I could bring the logic that’s inside the function and plug it in after the capsule trace but for the sake of clutter is why I wanted to condense this into a function. I’d be casting to 30+ other blueprints in my event graph and it would look messy real quick.

Thank you guys for the help, I was able to fix the function by getting the root component and then owner of that in order to cast properly to the multiple blueprints.