Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Mudley | |
Old Version | Published before Godot 3 was released. |
Is there a way to get the directory that the game’s .exe file is?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Mudley | |
Old Version | Published before Godot 3 was released. |
Is there a way to get the directory that the game’s .exe file is?
Reply From: | eons |
Something like Globals.globalize_path("res://")
should do the trick.
http://docs.godotengine.org/en/stable/classes/class_globals.html#class-globals-globalize-path
Reply From: | earlroxas |
In Godot 3.2 you can use OS.get_executable_path()
to get the path of exe file (including the exe filename and extension). If you want to get only the directory use OS.get_executable_path().get_base_dir()
source