📱Streaming & Multiplatform
Last updated
Last updated
On Keyboard & Mouse | Using Touch Controls |
---|---|
MSquared supports releases on multiple platforms, with others additionally supported through the power of streaming. If your project needs to handle these different platforms separately, we have some helpers and recommended flows to enable this.
Some helpers if you want to differentiate based on using streaming or not:
Ubitus is not currently supported, please reach out through support channels for details
IsAStreamingClient
: Returns true if the client is running via a game streaming provider (e.g. Geforce Now or Ubitus)
GetStreamingClient
: Returns the streaming client type (Geforcenow
, Ubitus
, or Other
)
In the M2_GameInstance
, we have a number of device and control type related helpers:
IsRunningOnMobile
: Checks if we are running on a mobile OS
(If you are using a streaming client, this will be the OS of the device, rather than the machine that is hosting)
IsRunningOnIPadOS
: Checks specifically if we are using an iPad OS
NOTE: Only works for GFN streaming
GetDeviceType
: Returns either Mobile
, Tablet
, or Unset
(for PC etc.)
In a similar vein to "mobile", we have the concept of using touch controls. The two are not exactly the same, since some PCs can use touch controls, and you can easily simulate touch controls in-editor using Editor Preferences -> Use Mouse for Touch
.
These are handled in-game using different events, e.g. InputTouch
vs LeftMouseButton
To detect if you are using touch controls, you can use your player controller (cast to at least J_PlayerController
):
UsingTouch
: Returns whether we are using touch input or not
OnUsingTouchChanged
: This event is triggered when the first touch is detected (so we know we are using touch controls). This can be used to e.g. enable UI that only applies to touch controls.
Currently console work is unsupported