Made For Unreal — Docs
Blueprint CheatsAPI ReferenceC++ API

UBlueprintCheatsSubsystem (C++)

The local-player subsystem that owns enabled cheats, registers console commands and hotkeys, and routes execution.

UBlueprintCheatsSubsystem owns enabled cheats for the local player, registers their console commands and hotkeys, opens the overlay menu, and routes execution through each script's gates.

  • Header: Source/BlueprintCheats/Public/BlueprintCheatsSubsystem.h
  • Module: BlueprintCheats (Runtime)
UCLASS()
class BLUEPRINTCHEATS_API UBlueprintCheatsSubsystem : public ULocalPlayerSubsystem;

Lifetime

One instance per ULocalPlayer.

virtual void Initialize(FSubsystemCollectionBase& Collection) override;
virtual bool ShouldCreateSubsystem(UObject* Outer) const override;
virtual void PlayerControllerChanged(APlayerController* NewPlayerController) override;

ShouldCreateSubsystem returns false in shipping builds when bDisableOnShipping is true. Under that combination no subsystem is spawned, so no cheats, console commands, or hotkeys exist at all.

PlayerControllerChanged keeps OwningPlayerController in sync with the active controller — the subsystem always has a current controller to execute against.

Initialize subscribes to UWorld::OnWorldMatchStarting so the subsystem rebuilds the enabled-script list per match.

Public API

UFUNCTION(BlueprintCallable)
void EnableScript(const TSubclassOf<UBlueprintCheatScript>& ScriptClass);

UFUNCTION(BlueprintCallable)
void EnableScripts(const TArray<TSubclassOf<UBlueprintCheatScript>>& ScriptClasses);

UFUNCTION(BlueprintCallable)
void ExecuteScript(const UBlueprintCheatScript* ScriptToExecute);

EnableScript

Enables a single class at runtime: instantiates it, calls OnEnabled, binds its hotkey, registers its console command if applicable. Internally calls EnableScript_Internal against the world's first player controller. For multi-local-player setups, prefer to call this once per local player's subsystem via ULocalPlayer::GetSubsystem.

EnableScripts

Convenience wrapper that calls EnableScript for each entry.

ExecuteScript

Menu execution path:

LeaveMenu();
if (Script->CanExecute(OwningPlayerController, OutMsg))
{
    bSuccess = Script->Execute(OwningPlayerController, OutMsg);  // C++ overload
    Script->ResetState();
}
LogExecution(Script->GetScriptDisplayName(), OutMsg, bSuccess);

This is what the default menu row binds to its execute button. Custom menus and tooling can call it directly.

Internal flow (read-only summary)

MethodTriggered byBehavior
OnWorldMatchStartedUWorld::OnWorldMatchStarting delegate.Re-registers all enabled scripts and rebinds the menu hotkey for the new world.
EnableScript_InternalEnableScript and OnWorldMatchStarted.Instantiates the class, binds its hotkey, registers its console command.
OnMenuKeyTriggeredThe IMC's menu hotkey input action.Toggles the cheat menu. Pauses if bPauseGameWithMenu. Sets Game-and-UI input mode.
OnInputTriggeredScriptA script's bound input action.Calls ExecuteScriptFromConsole with empty token array.
OnConsoleCommandExecutedRegistered console command.Forwards the raw token array to ExecuteScriptFromConsole.
ExecuteScriptFromConsoleConsole / hotkey paths.CanExecuteExecuteRawArguments(rawArgs) → log.
LeaveMenuClose button or pre-execute cleanup.Restores Game-only input mode, hides cursor, unpauses, removes the menu widget.
LogExecutionBoth execution paths.Writes to LogBlueprintCheats and shows on-screen debug text when enabled.

Registration order on world match start

  1. Clears EnabledScripts.
  2. Loads classes from UBlueprintCheatsSettings::EnabledScripts (project-wide).
  3. Loads classes from UBlueprintCheatsSettings::WorldEnabledScripts for the current world.
  4. If the level uses ABlueprintCheatsWorldSettings, loads its WorldCheatScripts.
  5. For each class: NewObject an instance, call OnEnabled, bind its InputAction (Triggered always; Ongoing too when the script opts in), register its console command (with the prefix from UBlueprintCheatsSettings::CheatsConsolePrefix).
  6. Adds the configured IMC to the local player's UEnhancedInputLocalPlayerSubsystem at priority 0 and binds UBlueprintCheatsInputMappingContext::MenuHotkey to OnMenuKeyTriggered.

Hotkey and menu-key bindings are gated off on PLATFORM_MOBILE. Console commands still register on mobile.

Logging

DECLARE_LOG_CATEGORY_EXTERN(LogBlueprintCheats, Log, All);
  • Successful runs log at Display; failures log at Error.
  • Each entry includes the script display name, success/failure, and the outcome message you set inside Execute.
  • On-screen messages (5-second TTL, FColor::Green / FColor::Red) are gated by UBlueprintCheatsSettings::bDisplayMessagesToPlayer.

Accessing the subsystem

if (ULocalPlayer* LocalPlayer = ...)
{
    if (UBlueprintCheatsSubsystem* Cheats = LocalPlayer->GetSubsystem<UBlueprintCheatsSubsystem>())
    {
        Cheats->EnableScript(MyCheatClass);
    }
}