+1 vote

I want to know the platform that is running my game, but I want to even know that in HTML5. I mean I want to know if this HTML5 is running on a pc or on a phone.

Godot version 3.4.2
in Engine by (17 points)

2 Answers

0 votes

Class OS has a method get_name() which returns a string identifying the current platform. However, it counts HTML5 as a platform, so this won't work for your use case.

Instead you could use get_model_name(). It returns the model name on Android and iOS, but returns "GenericDevice" on unsupported (i.e. PC) platforms.

by (102 points)
0 votes
by (18 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.