Calling Custom Console Commands

A simple question
i call “t.MaxFPS 60” from console and it sets max fps to 60. So i assumed i would call an exec function with one param which is FString from console like this “SomeCommand SomeString”, but it didn’t worked.

Here it is

// Class is derived from AActor

// Header
UFUNCTION(Exec, Category = IPC)
void SendCommandToCE(const FString Command);

// Source
void ACECommunication::SendCommandToCE(const FString Command)
	if (CEProcess)

Then i tried calling it from console like this “SendCommandToCE something” and it gives me “Command not recognized : SendCommandToCE uci”

I tried putting it between quotes since it is a string but the same. How can i call this?

Ok, i change the question. How do you create exec commands from scratch?

I know that Execs can be placed in specific places. I know it will work when You add them to PlayerController or to the GameInstance (and maybe GameEngine).

I don’t think it will work in any Actor.

Aside of Exec, there Command Delegates, but not sure how to use them, check commands in editor and search command in github to get examples. Here few examples that i found:

This one seems easier:

You can also hook up to Exec() in your own UGameViewportClient

Just remember too add Super::Exec at the end of it or else you will kill off lot of commands. Also this method won’t work with auto complete, you will need to add stuff in Input.ini

Just found this, after you have answered. Console Varaibles C++ In Unreal Engine | Unreal Engine 5.2 Documentation

There says: By registering console commands and variables in the console manager you get auto completion and enumeration to get a list of all console objects (console command Help or DumpConsoleVariables). Because of this, you should avoid the old Exec interface

Sigh… It should say the same inside UFUNCTION() page. But it doesnt. Sometimes how slow UE Doc is updated kills me.

Thank you for answering.