According to the documentation the cheat manager does not work in shipping build.
But are it doing it, have I missed a hidden checkbox?
Nope, that’s how it acts by default. The code comments were recently updated to reflect that but I guess the documentation is still wrong.
Check APlayerController::EnableCheats, APlayerController::AddCheats and AGameModeBase::AllowCheats, you’ll see that in SHIPPING builds cheats are only enabled on the server while in non-SHIPPING builds and in the editor they’re allowed for everyone.
To fix this, override AGameModeBase::AllowCheats in your game’s GameMode class:
.h
virtual bool AllowCheats(APlayerController* P) override;
.cpp
bool AYourGameGameMode::AllowCheats(APlayerController* P)
{
#if UE_BUILD_SHIPPING
return false;
#else
return Super::AllowCheats(P);
#endif
}
Thanks!!
This has been fixed in UE5 and that override is no longer necessary.
3 Likes