Error: Unrecognized type 'UTankAimingComponent' - type must be a UCLASS, USTRUCT or UENUM

Does someone know how to fix this ?
Also, if someone is wondering, this is my piece of code, exactly as it is in the video:

class UTankAimingComponent;


  • Responsible for helping the player aim
    class BATTLETANK_API ATankPlayerController : public APlayerController

UFUNCTION(BlueprintCallable, Category = “Setup”)
ATank* GetControlledTank() const;

UFUNCTION(BlueprintImplementableEvent, Category = "Setup")
void FoundAimingComponent(UTankAimingComponent* AimCompRef); 

Did you remember to include TankAimingComponent.h from TankPlayerController.cpp?

Also wanna add on 4.21.2:
Watching the video, class UTankTankAimingComponent is included yet UTankAimingComponent* is used.
The Controller.cpp file needs #include “AimingComponent.h” Like previously stated

Privacy & Terms