Godot is a free and open-source platform that can export games for all major operating systems. In addition to exporting games as pre-packages standalone apps or .exe files, Godot also makes it easy to share full project directories for open-source development. By opening a project in Godot, you can not only play and test it, but also modify the code, 3D assets, or anything else you want.
Poking around the code of an already-built project is a great way to get acquainted with Godot. This vault contains a number games, calculators, and simulators built with Godot, and if you want, you can open and freely modify them. Here's how to do that.
## **Prerequisites:**
First, Install [[Godot Game Engine]] if you haven't already. The vault contains Godot 4.1 for Windows as an offline copy, or you can download it from their website. The projects in this vault are built for Godot 4.1, and are not directly compatible with later versions, so be sure to get 4.1 if you download it yourself.
### 1. **Extract and Open a Godot Project from a Zip File**
1. **Extract the Zip File**:
- Locate the zip file containing the Godot project.
- Extract it to a folder on your computer. Make sure to remember the location where you extracted it.
2. **Open the Project in Godot**:
- Launch Godot, and in the Project Manager, click on **Import**.
- Navigate to the folder where you extracted the project, and select the `project.godot` file (this is the main project file).
- Click **Open** and then **Import & Edit** to load the project into the editor.
### 2. **Test-Play the Main Scene**
1. Once the project opens, identify the **main scene** you want to test.
- Typically, this is defined in the **Project Settings** as the **main scene**.
- You can view or change this setting by going to **Project** > **Project Settings** > **Run** > **Main Scene**.
2. **Run the Scene**:
- With the main scene selected in the **Scene** panel (or any open scene you want to test), click the **Play** icon (a green triangle) at the top-right of the editor.
- Godot will run the selected scene in a new window, allowing you to test it.
### 3. **Overview of the Godot UI**
The Godot editor interface is divided into several main areas:
- **Scene Dock** (Top Left): Shows the node hierarchy for the open scene. You can add, delete, or rearrange nodes here.
- **FileSystem Dock** (Bottom Left): Shows all files in your project directory. You can access scenes, scripts, textures, and other resources here.
- **Inspector Dock** (Right Side): Displays properties for the selected node, allowing you to adjust node settings like position, size, visibility, and more.
- **Viewport (2D/3D)** (Center): This is the main workspace where you edit scenes in 2D or 3D mode.
- **2D Mode**: Use this for working with 2D scenes, sprites, and UI elements.
- **3D Mode**: Use this for working with 3D models, lights, and cameras.
### 4. **Modifying Scripts**
1. **Access the Script Editor**:
- Click on the **Script** icon at the top of the editor to switch to the Script workspace.
- Alternatively, you can open a specific script by double-clicking it in the **FileSystem** dock.
2. **Edit a Script**:
- The Godot script editor is where you write and modify GDScript code.
- You’ll see functions, variables, and any pre-defined code for the script you’ve selected. Make changes directly in the text editor.
3. **Save and Test**:
- Once you’ve made changes, press **Ctrl+S** (or **Command+S** on Mac) to save the script.
- Run the scene again to test your modifications.
### 5. **Modifying Objects in the 2D Viewer**
1. **Switch to 2D Mode**:
- Click the **2D** tab at the top of the viewport to enter the 2D workspace.
2. **Select a Node**:
- In the **Scene** dock, click on a node to select it. The selected node will appear in the 2D viewport with handles for transforming it.
3. **Edit Properties**:
- In the **Inspector** dock on the right, adjust properties like **position**, **rotation**, **scale**, or any custom settings the node may have.
- Use the toolbar in the 2D viewport to move, rotate, or resize the object directly by dragging its handles.
### 6. **Modifying Objects in the 3D Viewer**
1. **Switch to 3D Mode**:
- Click the **3D** tab at the top of the viewport to enter the 3D workspace.
2. **Select a Node**:
- In the **Scene** dock, click on a node to select it. You’ll see transform handles appear on the object in the 3D viewport.
3. **Adjust 3D Properties**:
- In the **Inspector** dock, modify properties like **translation**, **rotation**, **scale**, and others specific to 3D objects.
- Use the move, rotate, and scale tools in the 3D viewport toolbar to manipulate the object directly in the 3D space.
### Summary
- **Extract** the project, open it in Godot, and select the main scene.
- **Run the scene** with the Play button to test it.
- **Navigate** the Godot UI using the Scene, FileSystem, and Inspector docks, as well as the 2D/3D viewports.
- **Modify scripts** in the Script Editor and **edit objects** in the 2D or 3D viewers using tools in the Inspector and viewport.
This setup will give you a basic understanding of Godot’s workflow, enabling you to edit and test scenes effectively.
If you mess things up, you can always just start over by re-extracting the ZIP directory.