'Third Person Character' Does not inherit from 'Primitive Component' warning

Hi need help figuring this out. I am just trying to trigger an overlap event on an item so the name appears but I am getting this warning and when I overlap my item I don’t see any text. Thanks

1 Like

“ThirdPersonCharacter” is an “AActor”.
“OverlappedComponent” is a “UPrimitiveComponent”.

You are trying to cast the “UPrimitiveComponent” to the ThirdPersonCharacter, but it’s not inheriting from it.
That means the “UPrimitiveComponent” is not a parent of it and the casting will fail always.
You simply can’t cast a Parent to a Child that is 100% not a Child of it.

Also this is only a warning. It’s not actually an error. It gives you a small hint that the logic you setup makes no sense.

If you don’t understand these words, please make sure to inform yourself about “Inheritance” in Object Orientated Programming Languages.

To fix your problem, connect the “OtherActor” to the Cast node, instead of the “OverlappedComponent”.

5 Likes

Thanks for you help!

Thanks mate! This helped my problem aswell :slight_smile:

Still helping after 3 years, Thank you :slight_smile:

Agree with @MrAdom89 , your reply was still helpful

thanks! This helped my problem aswell

Still helping after 6-7 years. had my end overlap plugged into other comp instead of other actor. thanks dude. :laughing: