Custom command not recognised

Hi all.

I’m trying to use a custom screenshot console command from my C++ plugin but it doesn’t work with the error

Command not recognized: TakeScreenShot

Here is my code:

305938-capture.png

I’m not sure what’s going wrong with this, thanks for any help.

“Only some classes support Exec functions out of the box. Possessed Pawns, Player Controllers, Player Input, Cheat Managers, Game Modes, Game Instances, overriden Game Engine classes, and Huds should all work by just adding the standard UFUNCTION markup.” - Wiki

Have you made sure it is being executed from a valid class?

Good luck!

Ahh, I didn’t realise the BlueprintFunctionLibrary wasn’t the right type of class. I’ve now put it into a custom cheat manager class and it’s working fine, thanks!