0 votes

Is there a GodotSharp alternative to Engine.getmainloop().quit()?

in Engine by (246 points)

Why are you searching for an alternative? What's wrong with this function?

I can't find the C# equivalent to exit the game. Is there an api reference online somewhere?

2 Answers

0 votes
Best answer

I found it! I was Originally calling Engine.GetMainLoop.(LIST OF METHODS) and GetTree.(LIST OF METHODS)but quit is under GetTree().Quit() Thanks Zylann.

by (246 points)
+2 votes

Looking at this doc page: http://docs.godotengine.org/en/latest/learning/features/misc/handling_quit_requests.html

It seems Engine.get_main_loop().quit() doesn't exist. Instead the function is in SceneTree, and you trigger it by doing get_tree().quit().

Note that in C# the name format is CamelCase instead of snake_case, but the API is the same for all languages (and specified as snake_case^^)

by (29,092 points)
edited by
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.