Making the main scene and setup
Preview
You will be making a 3D racing game with a track, timer, lap counter, menu, and (of course) a race car!
Setting up the main scene
-
Select 3D Scene and rename to “Game”.
-
Add a child MeshInstance3D and rename to “Ground”. In the Inpector:
-
Select New BoxMesh under Mesh.
-
Click the BoxMesh and change the Size to (x: 50, y: 1, z: 50).
-
Still in the BoxMesh, under Material, select New StandardMaterial3D.
-
Find a road picture (preferably .png) so you can see where the car is going.
- Download it into your racing game folder (I found mine here, on OpenGameArt).
- In the Grounds’ Inspector > Mesh > Material > Albedo > Texture, click ‘Load’ and select your texture.
- You will also need to change this Size to (x: 50, y: 1, z: 50).
- To make the texture repeat itself: UV1 > Triplanar to ‘On’.
- To make the texture not repeat as much, you can toggle with the UV1 > Scale properties.
-
When on the Ground node, the menu bar will have a Mesh button.
Create a collision shape and change Collision shape placement to
Static Body Child
. -
Save your scene.
Current Look
Your ground should now have repeated your picture and look something like this:
Checklist
- I have imported and used a ground texture.
- I have a Game node and a Ground node.
- I’m ready to make the car!