system
November 9, 2017, 4:12am
1
Attention
Topic was automatically imported from the old Question2Answer platform.
Asked By
SupToasty
Old Version
Published before Godot 3 was released.
Is there a GodotSharp alternative to Engine.get_main_loop().quit()?
Why are you searching for an alternative? What’s wrong with this function?
Zylann | 2017-11-09 19:10
I can’t find the C# equivalent to exit the game. Is there an api reference online somewhere?
SupToasty | 2017-11-10 00:28
system
November 10, 2017, 1:00am
4
Reply From:
Zylann
Looking at this doc page: Handling quit requests — Godot Engine (latest) documentation in English
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
^^)
system
November 10, 2017, 3:15am
5
Reply From:
SupToasty
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.