set_script
Attach a script to a node in a Godot scene. Creates the script file automatically if it doesn't exist.
Instructions
Attach a script to a node in a scene. Creates the script file if it does not exist.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodePath | Yes | Path to the node (e.g., "root/Player") | |
| scenePath | Yes | Path to the scene file (relative to project) | |
| class_name | No | Optional class name for the script (for C# or GDScript classes) | |
| scriptPath | Yes | Path to the script file (relative to project, e.g., "scripts/player.gd") | |
| projectPath | Yes | Path to the Godot project directory | |
| scriptLanguage | No | Script language: "gdscript" or "csharp" (default: "gdscript") |