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.