In this lecture, we were told that we had to include both the Engine/World.h and GameFrameWork/PlayerController.h to be able to access the Player pawn from within the OpenDoor.cpp file.
However, I jumped the gun slightly and added the required code, successfully tested setting up the pawn and confirmed that I was able to open the doors in game before we were told to include these.
My includes are below:
#include "OpenDoor.h"
#include "GameFramework/Actor.h"
the relevent section of code is here:
ActorThatOpensDoor = GetWorld()->GetFirstPlayerController()->GetPawn();
I had no problems compiling and everything is working fine without the headers so I am slightly confused as to what is happening with this.
I am using Unreal 4.27.1 so I guess that may be why it works for me without the extra headers but after all the above information, I guess my questions are why does it work without these headers included and will not having them added now cause me issues further into the section?
Thanks in advance
Jamie