+8 votes

is there a way to know, whether we are running on Android, iPhoneOS, MacOS, Linux ?

in Engine by (69 points)

1 Answer

+12 votes
Best answer

This should work.

OS.get_name()

http://docs.godotengine.org/en/latest/classes/class_os.html#class-os-get-name

String get_name() const
Return the name of the host OS. Possible values are: "Android", "BlackBerry 10", "Flash", "Haiku", "iOS", "HTML5", "OSX", "Server", "Windows", "WinRT", "X11"
by (545 points)
selected by

Would Xbox OS be Windows for something different, I know it runs a version of Windows but I just wanted to know if its called something different

It would be "UWP".

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.