Vehicle template

A driving starter: a race car on the vehicle component, a Racing Kit circuit with checkpoints, a lap timer, three cameras and a respawn, with no compile step.

Last updated Dec 4, 2026Version 1.1.0

The Vehicle template is a time trial. A Kenney race car on the engine's vehicle component, with real wheel suspension, laps a Racing Kit circuit of straights and corners. Four checkpoint gates run a three lap timer with a best lap, and the HUD shows speed and the camera in use. It plays on the Vehicle Kit Feature or Kit, which Config/Features.ini enables, so no module needs building.

Your best lap is saved. The game mode writes it to the VehicleTimeTrial save slot (BestLap, in seconds) whenever a lap beats the saved one, and the next run starts with it on the HUD. The car also shows in the editor viewport before you press Play: the body and four wheels named by bodyMesh and wheelMesh on BP_RaceCar are previewed as generated content, which is never written to the level.

Controls

InputAction
W / S, triggersThrottle and brake; reverse when stopped
A / D, left stickSteer
Space, A buttonHandbrake
R, Y buttonRespawn at the last checkpoint you passed
C, X buttonCycle the camera: chase, far, bumper

The car also puts itself back on the road after three seconds on its roof, or if it falls off the world.

How it is built

AssetWhat it does
Assets/Scenes/Main.mmapThe circuit on a grass field with trees, a start gate with a banner and flags, a grandstand, a pit office, four ARaceCheckpointActor gates named Gate_0 (start and finish) to Gate_3, the race car and the HUD
BP_RaceCarA Visual Script class on AVehiclePawn. Its defaults name the body and wheel meshes and the chassis and wheel dimensions. When play begins the pawn builds the rigid body, the collider, the vehicle component and four wheel visuals
BP_RaceGameModeA Visual Script class on ATimeTrialGameMode with the lap count. It reads the gates in order, runs the lap timer and hands the placed car to the player
Assets/Audio/Tyres/Tyre_Squeal.oggThe looping tyre squeal. It is Kenney's creak sound, the closest friction sound the engine ships; swap in a real tyre loop through squealClip on BP_RaceCar
Assets/Decals/M_SkidMark.matThe dark decal material laid where a tyre slides, named by skidMaterial on BP_RaceCar
Assets/Input/The Drive, Handbrake, Reset and CameraMode actions and the default mapping context, for keyboard and gamepad
Assets/UI/HUD.uiLap, race time, lap time, best lap, next gate, message, speed and camera labels, bound to the timetrial.* and vehicle.* HUD sources

Tyre feedback

The car reads the wheel telemetry of its vehicle component and turns it into three things. The pawn also switches on ABS and traction control (driverAssists).

  • Squeal. A looping sound follows the worst wheel's combined slip: silent below slipOnset, louder and higher as the tyres slide, and silent at a crawl, where a locked wheel is not a noise.
  • Skid marks. Where a wheel slides past slipOnset on a surface that takes a mark (not ice or water), the car lays decals along its heading, one every 0.4 m. They fade over skidLifetime seconds and at most skidMaxMarks live at once.
  • Haptics. While the player drives the car with a gamepad, the big rumble motor follows how rough the surface is (gravel shakes, ice does not) and the car's speed, the small motor follows slip, and ABS or traction control pulses it. hapticsStrength scales it and 0 turns it off. The rumble stops when the player leaves the car.

Set squealClip or skidMaterial empty to drop that effect.

Make it yours

Add Racing Kit pieces from Assets/Racing/Track and move the gates. A gate is an ARaceCheckpointActor whose name ends in its position in the lap. Swap bodyMesh on BP_RaceCar for Car_Sedan.glb or Car_SUV.glb and adjust bodyHalfWidth, trackHalfWidth and bodyOffsetY to match, or tune topSpeed, steerRate and the camera values.

See Templates for how a template becomes your project.

Engine sources

This page describes behavior implemented in these files of the engine repository, checked against commit ca6dab926.

  • Templates/TP_Vehicle/README.md
  • Templates/TP_Vehicle/Config/TemplateDefs.ini
  • Templates/TP_Vehicle/Config/Features.ini
  • Templates/TP_Vehicle/TP_Vehicle.mproject
  • Templates/TP_Vehicle/Assets/Blueprints/BP_RaceCar.vscript
  • Templates/TP_Vehicle/Assets/Blueprints/BP_RaceGameMode.vscript
  • Engine/Kits/VehicleKit/Api/VehicleKit/AVehiclePawn.h
  • Engine/Kits/VehicleKit/Api/VehicleKit/ATimeTrialGameMode.h
  • Engine/Kits/VehicleKit/Api/VehicleKit/ARaceCheckpointActor.h

Page feedback

Was this page helpful?