Can you implement a console command on an AI controller?

I tried implementing a console command in my AI controller like this:

// .h
UFUNCTION(Exec, Category = “Console Command”)
void ToggleAIDebug();

// .cpp
void ToggleAIDebug()
{
UE_LOG(LogTemp, Warning, TEXT(“Hit debug”));
DrawDebug = !DrawDebug;
}

ToggleAIDebug shows up in the console command window in-game, but the function isn’t getting called. I read somewhere that said certain classes couldn’t run console commands, is that the case for AIControllers or am I doing something wrong?

As far as I could find, at least for 4.20 the answer is no. I ended putting mine on the player controller, works well. I did have to make sure in the world setting that the player controller was set to the one with the console commands on it, otherwise it didn’t recognize the commands even though it showed them in the console.