Download

Get Virtual Joystick Visibility? (or Get Device type?)

Hello, I know there’s Set Virtual Joystick Visibility, but there doesn’t appear to be any Get. I’m basically trying to create a UI that appears with buttons when the virtual joysticks are available, so that you have access to abilities on tablet, but the buttons are hidden on PC.

Is there an alternative way I can do this? (other than having two copies of my game for each platform which I’d rather not do until my game was closer to completion) Such as getting the device type or something?

Thanks for any help :slight_smile:

Hi, using a single bool on save data can be use to achieve that. Also, the virtual joystick will only visible on touch surfaces.

How would I set the bool though? What would I base it off of?

Since your game would certainly create a save game object on a first run and load game from slot at Event Begin Play at levels, use the bool, e.g. named isTouch - to determine whether to create the widget that was intended for mobile only, then add it to viewport.

So when packaging your game for mobile, the only change that you’ll need to make is to set the bool value to true from the save game blueprint. I hope that’ll make sense to you, but really, its quite that simple :slight_smile: