Error on Project Packaging - must inherit UObject

Hi Everyone,

Very new to Unreal (also no knowledge about C++) so please bear with me. I have searched these forums to answer my issue but to no avail.

Upon Packaging my project for Windows, I get an error in the Output Log:

Error: Class ‘AMyNewPlayerController’ must inherit UObject or a UObject-derived class

#pragma once
 
 #include "Kismet/BlueprintFunctionLibrary.h"
 #include "GameFramework/PlayerController.h"
 #include "MyNewPlayerController.generated.h"
 
 /**
  * 
  */
 UCLASS()
 class YOURPROJECT_API AMyNewPlayerController ; public APlayerController
 {
 
     GENERATED_UCLASS_BODY()
 
 public:
     UFUNCTION(BlueprintCallable, Category = "YOURCATEGORY")
     static bool Viewport__SetMousePosition(const APlayerController* ThePC, const float& PosX, const float& PosY);
     
 };

I am very confused as I have only used Blueprints and never touched the code.

Your help is appreciated!

Jason

Hello, did you solve the problem? I have the exact same one and I’m struggling to solve it :frowning: