In my GameMode I’m trying to Spawn the character of my player and then make my controller posses that pawn, but the game crash with a window saying “Fatal Error!” with the line:
What I could be doing wrong?
The game also Crashes when I try to get the NetOwner of the ActualP pawn I just spawned.
This is my code:
[FONT=Courier New]auto Actual = GetWorld()->SpawnActor(Skin, &Location, &Rotation);
APawn* ActualP = Cast<APawn>(Actual);
if (ActualP == nullptr)
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, *FString(“Error”));
if (ActualP->Controller == nullptr)
//The Error is here