godot-demo-projects/3d/truck_town
Aaron Franke 5646c6a7a8
Open and save 3D demos in Godot 4.3 stable (#1109)
2024-08-27 13:40:06 -07:00
..
car_select Use static typing in all demos (#1063) 2024-06-01 12:12:18 +02:00
screenshots Update most demos for Godot 4.0.beta10 (#782) 2023-01-05 16:50:17 +01:00
town Open and save 3D demos in Godot 4.3 stable (#1109) 2024-08-27 13:40:06 -07:00
vehicles Open and save 3D demos in Godot 4.3 stable (#1109) 2024-08-27 13:40:06 -07:00
.gitattribute
README.md Replace instances of KinematicBody with CharacteBody in READMEs 2024-07-12 23:06:00 +02:00
icon.webp Use 128×128 WebP icons for all demos (#885) 2023-03-29 18:59:57 +02:00
icon.webp.import Use 128×128 WebP icons for all demos (#885) 2023-03-29 18:59:57 +02:00
project.godot Open and save 3D demos in Godot 4.3 stable (#1109) 2024-08-27 13:40:06 -07:00
spedometer.gd Use static typing in all demos (#1063) 2024-06-01 12:12:18 +02:00

README.md

Truck Town

This is a demo implementing different types of trucks of varying complexity using vehicle physics.

Controls:

  • Up Arrow, W, Gamepad Right Trigger, Gamepad A/Cross: Accelerate
  • Down Arrow, S, Gamepad Left Trigger, Gamepad B/Circle, Gamepad X/Square: Brake/reverse
  • Left Arrow, Gamepad Left Stick, Gamepad D-Pad Left: Steer left
  • Right Arrow, Gamepad Left Stick, Gamepad D-Pad Right: Steer right
  • U, Gamepad Select, left-click speedometer: Change speedometer unit (m/s, km/h, mph)
  • C, Gamepad Y/Triangle: Change camera (exterior, interior, top-down)
  • Escape, Gamepad D-Pad Up: Go back to menu (press again to exit)

On mobile platforms, the vehicle automatically accelerates. Touch the left and right edges of the screen to steer. Touch the middle of the screen to brake/reverse (this also temporarily stops acceleration).

Language: GDScript

Renderer: Forward+

Check out this demo on the asset library: https://godotengine.org/asset-library/asset/2752

How does it work?

The base vehicle uses a VehicleBody3D node. The trailer truck is tied together using a ConeJointTwist node, and the tow truck is tried together using a chain made of RigidBody3D nodes which are pinned together using PinJoint nodes.

Screenshots

Screenshot