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:
https://developer.playcanvas.com/en/api/pc.platform.html
Another way is to do feature detection, for example check if device has a mouse, then ideally it’s desktop/laptop:
if(this.app.mouse) console.log('desktop');
Similarly if touch input is registered most likely it’s a mobile/tablet device:
if(this.app.touch) 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.
2 Likes
Also note that some laptops will have touch screens
2 Likes