GetOwner Error

Not sure if this modification is incorrect, but the GetOwner()->GetName() in the AimAt method said pointer to incomplete class type not allowed. The code still compiles since it has an actor when it is called in the tank class, but I found that including the Tank.h in the “cpp” removed the visual studios warning.

Indeed, same error here.
including #include “Runtime/Engine/Classes/GameFramework/Actor.h” in TankAimingComponent.cpp fixed it.
the error basically says the compiler cannot check if there is indeed a “GetName()” function at GetOwner, because it doesnt know what exactly is the Owner - its an incomplete type.

im very wary of including tank.h in this component, because this component is included in tank.h - isn’t this circular inclusion?

i dont very much understand it myself, if anyone can explain it better…

Privacy & Terms