Determine which OS and platform game is running on?

I’m hoping someone already knows the “best” way to determine this from in the game context.

I want to be able to determine the following:
User Operating Systems (Windows/Linux/iOS/Android)
Whether the user is running in native mode or in a browser

I’m guessing perhaps I should create a javascript block and use navigator.platform or perhaps rely on the “is mobile device” condition… but that’s not exactly right I don’t think.

Any help is appreciated, especially if you’ve done this before.

3 Likes

I moved this to feature requests. It can indeed be useful to have a way to check the platform.

1 Like

I think some path expressions can help with that.

I’ve found “navigator.platform” works pretty well for me to determine OS.

I’ve also found the following article to help determine if the client is running inside electron:

And another for Cordova:

I’m going to play with some combination of these… I’m unsure at this point whether a Cordova build is still using Electron under the covers.