Do environment variables work across all OS?

Godot Version

V4

Question

I want to pass a variable from an EditorPlugin plugin, to a tool scene in that same plugin. I want to avoid using a global variable because of Autoload. I am thinking of using environment variables with OS.set_environment() and OS.get_environment().

I am wondering if this method works across all the OS platforms that godot runs on. Any limitations in that respect. I’ve tested it on Linux and works fine. I assume Windows and Mac are same. What about ios and android?

It should, you can check the documentation to be sure, you might need to make sure the specific format is supported on all platforms, if you’re using special characters etc.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.