All work
GodotPrototype2025

Race 3D Combat Layer

Enemy AI, destructibles and a survival HUD layered onto a commercial racing template: navmesh-driven pursuers with raycast line-of-sight that hunt the player's vehicle.

The survival HUD over the template's drift smoke and skidmarks. Health and stamina are mine; the driving model is the template's.
The survival HUD over the template's drift smoke and skidmarks. Health and stamina are mine; the driving model is the template's.
Client
Fiverr (@a_narar)
Role
Gameplay Programmer
Platforms
PC, Mobile
Year
2025

This one starts from a bought racing template rather than an empty project, so it is worth being precise about the split. The template supplied the vehicles, the circuit, the car controllers, drift smoke, skidmarks, lights and the car select menu. What I built on top is the part that turns a driving demo into something with stakes: enemies that hunt you, objects that break, and resources you can lose.

The enemies run a hierarchical state machine over a navigation agent, moving between roam, chase and search behaviours. Detection is a raycast line-of-sight check on an interval rather than a plain area overlap, with a deliberate delay before a state change commits: without that debounce, an enemy standing at the edge of cover flickers between chase and search every frame.

What I built

  • Built the enemy AI: a hierarchical state machine over a NavigationAgent3D with roam, chase and search states, separate speeds per state, and randomised idle intervals so a patrol does not read as a loop
  • Wrote raycast line-of-sight detection on a fixed check interval with a state-change delay, so an enemy at the edge of cover settles instead of oscillating between states
  • Implemented the enemy attack set: a timed wide-area attack, a close-range attack, and optional projectile fire with configurable damage, speed and interval, all exported for tuning
  • Added destructible objects using fracture geometry, with an explosion impulse applied to the fragments on break
  • Built the survival HUD: health, stamina and a live speed readout against a session maximum
  • Wired mobile input through an on-screen virtual joystick alongside the desktop controls

Gallery

Health, stamina and speed against the session maximum.
Health, stamina and speed against the session maximum.
Line-of-sight debug draw. The green and red rays are the detection check that decides whether an enemy commits to a chase.
Line-of-sight debug draw. The green and red rays are the detection check that decides whether an enemy commits to a chase.

Breakdown

Detection is a raycast on an interval, not a trigger volume. An area overlap alone would let an enemy see through walls; the ray confirms the sightline before the state machine acts on it. A separate delay gates how quickly a state change commits, which is what stops an enemy at the edge of cover from flickering between chase and search on alternating frames.

Every behaviour value is exported: roam, chase and search speeds, idle ranges, roam radius, shot interval, damage figures for each attack type, bullet speed. The AI is tuned in the inspector rather than by editing the state scripts.

What the client said

5 out of 5
Bilal is the best artist I worked with, he is really professional and his work is always clean
a_narar, United States · 3 days
5 out of 5
Working with Bilal is always excellent, level of quality and communication is amazing
a_narar, United States · 7 days
5 out of 5
Bilal work is really professional and communication is excellent
a_narar, United States · 4 days
5 out of 5
Bilal is really professional and awesome to work with!
a_narar, United States · 4 days

Credits

Programming
Bilal AhmadEnemy AI, detection, attacks, destructibles, and the survival HUD: the work described on this page.
Base project
RNB Race 3D TemplateVehicles, race circuit, player and AI car controllers, drift smoke, skidmarks, lights, engine sound, and the car select menu.
Destruction plugin
JummitMIT licensed. Mesh fracture support behind the destructible objects.
Voronoi fracture
Robert VaradanMIT licensed. VoronoiShatter.
Mobile input
Virtual Joystick addonOn-screen joystick used for touch controls.

Built with

  • Godot 4.5
  • GDScript
  • NavigationAgent3D
  • LimboAI
  • Forward+ renderer