I am trying to perform this cast operation
auto temp = GetWorld()->GetFirstPlayerController();
auto Controller = Cast<ACustomPlayerController>(temp);
The Declaration for class ACustomPlayerController is as follows
class SHOOTINGGAME_API ACustomPlayerController : public APlayerController
However, the Controller variable returns a nullpointer. Can anyone explain to me why this cast is failing?