2. Create and run your first GDScript
1. Open a project. In the Adventure Database, add a native Script record. Select it to open the GDScript workspace.
2. Use an ID such as hello_gd and a readable name such as First GDScript. Keep script IDs unique across languages.
3. Enter the source below. Click Validate, then Apply Changes. Save the project.
4. Start a Test Scene or Play session. Use Run Script to execute the record against that runtime. A gameplay call needs a running game.
func run(call_context: Dictionary = {}) -> void:
Log("GDScript is running.")
await ShowMessage({"text": "Welcome to the workshop.", "duration": 2})Figure 2. The native GDScript workspace shows source, event subscriptions, the global-instance option and the script toolbar.
You can omit an extends line in a PCA script record. PCA then adds its PCAScriptBase, which inherits Godot’s Node class. You still have GDScript and Godot functionality, with the PCA helpers available as inherited methods.
