Object References Not Compatible

In my weapon blueprint after the line trace has happened, I’m checking to see if the actor that was hit is equal to a character in the game. This worked yesterday, however opening up my project today I have incompatibility issues and can no longer connect these nodes together.

“Actor Object Reference is not compatible with BP Character Base Object Reference (by ref)”

Is the message tooltip I now get when trying to connect these nodes.

I would have thought that the BP_CharacterBase blueprint would work here as it is a child of actor, and the Out Hit from my line trace is looking for an actor. What am I doing wrong here?

It happens because OutActors and HitActor are different classes, and the Contains node has a wildcard value. It would be better to use Casting instead of Contains:

It does the same.

My Products

1 Like

So after the line trace im aiming to calculate the accuracy between shots hit on character targets and shots that missed the character target, Using your method does run my accuracy function, however it now only runs when a shot is hit, and doesnt calculate the shots missed. How can I solve this?

1 Like

Perfect! Thank you.