Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | AiTechEye |
Is there a way to check if the game is running by the editor or it self?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | AiTechEye |
Is there a way to check if the game is running by the editor or it self?
Reply From: | Calinou |
You can check for the presence of the standalone
feature tag:
if OS.has_feature("standalone"):
print("Running an exported build.")
else:
print("Running from the editor.")
Unlike OS.is_debug_build()
, it’ll evaluate to true
even in debug export templates.
Reply From: | DavidPeterWorks |
I use this to skip the intro scene in editor (not to waste time).
func _ready():
if OS.has_feature("editor"):
get_tree().change_scene_to(nextScene)
You can check more options. Awesome stuff: