inject_script_autoload
Registers an existing GDScript as a Godot global Autoload singleton by editing project.godot. Use a res:// path to add the script to the project's singleton list.
Instructions
Add a GDScript as a Godot global Autoload singleton by editing project.godot. The script must exist in the project and use a res:// path.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scriptPath | Yes | Existing script resource path such as res://scripts/game_state.gd. | |
| projectPath | Yes | Absolute path to a directory containing project.godot. | |
| singletonName | Yes | Global singleton name, for example GameState. | |
| replaceExisting | No | Allow changing an existing singleton with the same name. Defaults to false. |