Problem creating a new PlayerController Class

Using Unreal 4.26.1

I had been having problems creating child classes but using the fixes provided in this course i have managed so far (rebuildind the project, deleting binares and or intermiates and rebuilding, changing the include paths for my header). But when inheriting from a PlayerController class into a new class the .cpp files cant open the .h file.

I tried changing the include path.
I tried searching for a linking or compiling error.
Not using a subfolder for the new PlayerController.
Using different names
I recreated the project from scratch but with c++ instead of BP, same problem.

It only happens when inheriting from a PlayerController Class, if i create a new class from a Pawn for example it works correctly.

But it doesnt matter what i try, my PlayerControllerBase.cpp cant call anything from my PlayerControllerBase.h, it reads other includes, just not its own header. So i cant get access to GetPawn() for example as it is not including the class functions.

This is my repo if someone wants to check it.

Below are some relevant code snippets, I know GetTest() is declared with arguments and defined without it, it was done to see if i could make it react to that error, but no, the cpp just take the defenition and implicitly declares it. The .cpp and the .h just refuse to interact with each other.

#include "ToonTanks/MyControllers/PlayerControllerBasic.h"
//#include "PlayerControllerBasic.h"

void GetTest()
	bool verdad = true;
	verdad = false;
#pragma once

#include "CoreMinimal.h"
#include "GameFramework/PlayerController.h"
#include "PlayerControllerBasic.generated.h"

class TOONTANKS_API APlayerControllerBasic : public APlayerController
	void GetTest(int32 test);

	bool testeo;

Problem Solved.

I was not defining the function correctly in the cpp, i was forgoting to add the namespace when defining the function… took 8 hours of my life xD well, i learned a lot in the process.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms