Cheat Manager Not Working (PIE)

Hey, trying to get the cheat manager working in my Dedicated Server Project. It won’t seem to work.

Steps:

  • I have sub-classed from the standard Cheat Manager
  • Created a custom function with test strings for successful fire
  • Enabled Exec. so that the function can be called from console
  • Added this custom cheat class to the cheat manager in the PlayerController
  • PIE and attempt to call function via console command
  • Error, command not recognised (but it appears in the drop down)

Any idea why? Do I need to set something up on the server? Do I need to enable cheats anywhere? Just trying to get it working in Editor first.

Notes:

  • The PlayerController I am using is C++ custom, but it is blank. It does not contain or override anything in C++
  • Using this LinkedIn Post as reference - Unreal Engine Cheat Manager: Simplified Debugging and Shortcuts
  • I have diagnosed this to server/client, the exec doesn’t seem to send a RPC to the server for this. So, how can this be enabled to be on the server / authority?

Update: attempted to recreate the cheat manager in C++ with an overridable RPC function and got this compile error that exec functions can’t be replicated…?

The naive but more correct way of doing it would be:

UFUNCTION(exec)
void Item(FString ItemName, int32 Quantity = 1);

// replicated version
UFUNCTION(Server, Reliable)
void Server_Item(const FString& ItemName, int32 Quantity = 1);

void UMyCheatManager::Item(FString ItemName, int32 Quantity)
{
Server_Item(ItemName, Quantity);
}

but that still won’t work because UCheatManager is a uobject and you can’t call RPCs on those. you need to go through some sort of actor, in this case the player controller. So you have to get the player controller, call a server function on that, which can then execute or route back to the server version of the cheat manager