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.

- 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


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
Bilal is the best artist I worked with, he is really professional and his work is always clean
Working with Bilal is always excellent, level of quality and communication is amazing
Bilal work is really professional and communication is excellent
Bilal is really professional and awesome to work with!
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