How do I use the cheat manager class properly?

Came across the cheat manager class by just looking through the classes, and it seemed really useful for debugging so I don’t have to manually turn it on or off before packaging to prevent, well… developer cheats. It says the cheat manager won’t be instantiated in shipping builds, so I figured I could just do a “is valid” check on it and if it’s there it would be a shipping build and I can disable cheats. Nice and simple. However, it’s always there. It spawns and I can call functions from within it just fine regardless of if the game is packaged as shipping or not.

So how do I actually use this class?

There Is a Overridable Method in GameMode

.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
}