Adapting your project for Mobile
Arcane Mirage also runs on mobile browser, and we help your project recognize on which type of browser is it opening. As in any project you will have to tell your project how to handle mobile browsing, for this we provide 2 solutions:
Manual:
With this setup, you will tell your project to always show the touch interface regardless of where is it being opened. This works nicely for creators that need a basic touch control and dont want to get into blueprint coding. 1. Go to Project Settings > Engine > Input and enable the "Always Show Touch Interface" setting. 2. After that on "Default Touch Interface" select the touch interface you want to use.
Automatic Detection:
With this method, you will use one of the Unreal Events we have created in the Arcane Mirage Player to ask which type of browser the experience is being played on, and you will activate the touch interface that you need. For this setup to work, you will have to: 1. Go to Project Settings > Engine > Input and enable the "Always Show Touch Interface" setting.
2. After that on "Default Touch Interface" clear your selection so there is no default touch interface.
3. Add the PixelStreamingInput component to the BP that will send and receive messages from the pixel streaming player. Usually, the GameMode Blueprint or the Player Controller Blueprint handles this but will vary according to your project logic.
4. Inside the Blueprint where you attached the PixelStreamingInput component:
Using "Send Pixel Streaming Response" with the descriptor "GetDevice" will make the pixel streaming player to send an On Input event that contains a JSON: { event: 'DeviceDescription', data: { mobile: bool } }
Which will show true or false on the mobile field depending if your experience is running on a desktop or mobile browser.
5. After binding the On Input Event and parsing the JSON, set the touch interface control to the one you want for mobile, or clear it if you are running on PC.
We provide an example project of this implementation which comes fully commented. https://github.com/ArcaneMirage/AutomaticTouchUI
Last updated