Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | dodgyville |
Is there a way to detect if we are in headless mode from within gdscript?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | dodgyville |
Is there a way to detect if we are in headless mode from within gdscript?
Reply From: | magicalogic |
Yes it does.
OS.has_feature("Server")
Returns true if it is running on a headless server.
Perfection! Thank you
dodgyville | 2023-01-03 05:25
For Godot4 you need DisplayServer.get_name() == "headless"
or
!DisplayServer.window_can_draw()
, depending on your use case…