I just created the A C++ Class for Game Mode Base and got this error while it was being created. Is this a bug in the latest unreal version. (Mine is 4.14.3).
bool AGameModeBase::SetPause(APlayerController* PC, FCanUnpause CanUnpauseDelegate /*= FCanUnpause()*/)
{
if (AllowPausing(PC))
{
// Add it for querying
Pausers.Add(CanUnpauseDelegate);
// Let the first one in "own" the pause state
AWorldSettings * WorldSettings = GetWorldSettings();
if (WorldSettings->Pauser == nullptr)
{
WorldSettings->Pauser = PC->PlayerState;
}
return true;
}
return false;
}
bool ACoinGameModeBase::SetPause(APlayerController* PC, FCanUnpause CanUnpauseDelegate /*= FCanUnpause()*/)
{
if (AllowPausing(PC))
{
// Add it for querying
Pausers.Add(CanUnpauseDelegate);
// Let the first one in "own" the pause state
AWorldSettings * WorldSettings = GetWorldSettings();
if (WorldSettings->Pauser == nullptr)
{
WorldSettings->Pauser = PC->PlayerState;
}
return true;
}
return false;
}
Yes, as I said the linker did not find the implementation from the Game Mode Base class for your child class.
You wrote this is a bug, but this behavior is the default case for many classes from the UE4 source code. You only inherit the methods the classes export from their module (e.g. “Core” or “Slate”). If a class has the MinimalAPI annotation then you cannot call its methods from your code and you have to implement them yourself when you inherit from it. See here.
I had a similar problem when changing engine versions from 4.13 to 4.14 - they changed GameMode to GameModeBase. I don’t know if that might have anything to do with it.