More of a text snippet than a tutorial, this is how it's possible to call a function when the game loses focus.
In this example we have put the callback function in a custom
APlayerController
subclass, but it could be just about anywhere.
Also it might be worth wrapping this feature in a UUserGameSetting
property
so players can disable it if they don't want it.
First we need to add Slate
to our MyProject.Build.cs
file:
Next, we need to add to our player controller in both the .h
and the .cpp
: