Detect if touch interface is enabled

How do I go about showing a button only when the game is running on mobile devices?

I would like to hide the pause button when the user is running on a PC or console, showing it only if the game is running on mobile devices with a touch interface.

I was thinking on exposing the variable CurrentTouchInterface in APlayerController to blueprints but I’m not sure how to do it, do I need to download the source and compile the editor with a patch for that? or can it be done with the editor downloaded through the Launcher?

1 Like

I am not sure how to detect if tocuh interface is enabled or not but another way could be to query the current platform the game is running on. In blueprint you simple use the GetPlatformName node:

Then you could do a string compare for Android for example.

Hope this helps a bit.

1 Like