'Nested' Includes between a custom pawn and a custom component
I'm trying to set up a UActorComponent for a custom pawn. This custom pawn, however, would also like a reference to its owner - which will always be the custom pawn.
Accordingly in my CustomPawn.h, I
However, in CustomComponent.h, in order to have a
This results in compiling errors, specifically an
What do you all suggest?
asked Feb 06 '16 at 05:14 PM in C++ Programming
You can access component's owner by GetOwner() method. It will return direct parent of component, I mean if component is attached to another component then GetOwner() will return that parent component. But in your case I think component is parented by actor itself, so you can use GetOwner() instead storing MyOwner property.
If you want to avoid recursive including, then you can use forward class declaration. Eg:
Follow this question
Once you sign in you will be able to subscribe for any updates here