Skip to content

Track Building

Click on the ’+’ button to create a new scene, and name it track_1.tscn.

  1. Add a Node3D.

  2. Add a Path3D to Node3D.

  3. In your main scene with the ground, drag this saved track scene into the Ground (the top) node. You might notice that the path is below (or in line with) the ground. You will need to decrease the y-position of the ground.

  4. Back in your track scene, you’ll notice that Path3D has extra options in the navigation bar. Hover over each of them to get an understanding of what their functions are. Picture of Path3D controls

    • Click on the green Add point button.
    • Click on the Y Axis (the top right coloured axes) so that each of these points will be at the same height.
    • Add your points.
    • To finish, click the blue triangle Close curve button.
    • Click the Select control points.
    • Hold shift and click each point to drag the control handles around.
    • It should something like this inside the world scene: Picture of curved path on the ground
  5. Move your path points up using the green up arrow. Picture of moving path point up

    • Add CSGPolygon to Path3D.
    • Set the Mode to Path.
    • Assign the Path Node to the Path3D.
  6. Changing the shape of the path
    Section titled Changing the shape of the path
    • Click the Polygons’ PackedVector2Array and you will see size 4 (we need 4 corners to make a rectangular path).

    These are the numbers I have entered in: PackedVector2Array's specific points

    Explanation
    • If you change corners 0 and 1 to have their x = -5, then corners 2 and 3 to have their x = 5, you will see the path widen.
    • If you leave corners 0 and 3 to have their y = 0, then change corners 1 and 2 to have their y = 0.1, the path will be thinner.
    • Now, move the car onto the track to see if the sizing of the path is good. If the sizing is bad, change the x and y to be wider or thicker, respectively.
  7. Tilting the path (if your end points haven’t joined together properly)
    Section titled Tilting the path (if your end points haven’t joined together properly)
    • photo of how to tilt
    • On Path3D, select the yellow circle button (which will then turn green) and then use the dots on each point to change each points’ tilt.
    • If you see any points in the path which doesn’t look ‘smooth’ enough, change the tilt.
  8. In the CSGShape3D section, tick the Use Collision checkbox so the car can drive on the path.

    • Inside the CSGPolygon3D, make a new StandardMaterial3D under Material.
    • Download this road picture from OpenGameArt. Rotate the picture.
    • Adjust the Scale under UV1 to fit your path. It should look something like this (some path points have been deleted to make this first track easy). photo of the path with a road picture as a texture, and less joining points
  9. Test it out and change the tilting, size, and height of the track if it’s too hard to complete.

Contribute Donate