6. Why Y-Up?
Well done if you spotted that one! You might recall when we were using Panda3D that Z was up! X and Y dictated position, Z height. Yet, here were are in Godot, and it’s the not the same! In Godot, Y is up. It’s not a massive difference once you get used to it, but is of course necessary knowledge to progress! Game engines do not all use the same coordinate system.
7. Where has my stuff gone?
If you quit the Godot editor, restart it, and then open your project… you’ll find a completely empty stage again! Don’t worry. Assuming you saved your scene, it is still there! You can either double click it in the File System explorer or hit Scene->Load Scene from the top menu. Phew! We’ll address this in the next section by assigning our scene as the “default scene” for the project (in other words, the scene that the game starts on and also the scene Godot will open by default for this project!).
8. Play the Game!
Look back to the screen shot of the node Inspector we showed earlier. Across the top, you will see control buttons – play, pause, stop and similar. Go ahead and hit the Play button. You will get a popup warning from Godot saying that no default scene has been assigned, and would you like to use the current scene as the default. Select OK. This will resolve the issue in the previous section (“where has my stuff gone?”), and also attempt to play the game.
What you’ll find, when the game starts, is … absolutely nothing! Just a blank screen. Why is this?
You might remember in previous issues, using Panda3D, we had to set up a game camera. Godot is no different. You need at least one camera to be able to see anything in a scene! Go ahead and right click on the root node in the Scene Tree. From the menu that appears, select “Add a Child Node“. A long list of possible nodes will be presented to you, thankfully with a useful search box!
Search for “camera”. Select camera and then hit the Create button. Voila, a camera is added to the scene! Much like the 3D model of the house, the camera has a position (transform), rotation and similar. This is true of all nodes (refer back to “By the power of inheritance!” in Issue 6). It also has some attributes unique to itself such as, for example, the field of view (FOV). Position the camera exactly where you would like the game to start. Now hit the “Play” button again and you should see something more interesting than a blank screen:
Our camera, in this instance, is a perspective camera, by default, and that’s fine for this project. Godot also supports Orthogonal and Frustum cameras. We won’t dwell on this for now, but note that all cameras must register with a Viewport node, which our main root node is!
9. Wrap up and Summary
A fair amount of ground covered quickly! We have installed and began to use a new game engine (Godot), found a way to create our 3D Interior (Sweet Home 3D), added our interior and positioned a camera to view the scene. The links below are recommended reading prior to the next issue:
- Getting started with Godot: https://docs.godotengine.org/en/stable/getting_started/step_by_step/index.html
- Types of Camera in Godot: https://docs.godotengine.org/en/stable/classes/class_camera.html
- The Godot Scene Tree: https://docs.godotengine.org/en/stable/getting_started/step_by_step/scene_tree.html
- Godot Viewports: https://docs.godotengine.org/en/stable/classes/class_viewport.html#class-viewport