Check if game is exported

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By AiTechEye

Is there a way to check if the game is running by the editor or it self?

:bust_in_silhouette: 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.

:bust_in_silhouette: 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: