Controlling the game

How can I check if my game is computer or phone

Hi @Ozden_Delibas,

There are some ways to do that by inspecting the navigator.userAgent and navigator.platform properties, you can find a lot of info if you search online. You can also use the following PlayCanvas API:

Another way is to do feature detection, for example check if device has a mouse, then ideally it’s desktop/laptop:

if( console.log('desktop');

Similarly if touch input is registered most likely it’s a mobile/tablet device:

if( console.log('touch');

There are some edge cases like with the new iPad OS which Apple attempts to identify it as desktop, so take note.


Also note that some laptops will have touch screens :grimacing: