Check if mobile

Hey I’ve written a blog post explaining it in detail: How to Check if a Player is on Mobile or Desktop

Checking for the device / user agent can be unreliable at times. Actually, even Phaser has to guess what the player’s device is because currently there isn’t a conform way to check that across all browsers & OS & devices. That’s why usually it’s much more reliable to check for touch input instead of trying to guess the user’s device.

Anyways, I’ve described both methods in my blog post if you’re interested.

3 Likes