Free guide
How to make a 3D game with AI
Play Capybara Kart free: leverageai.io/play/capybara-kart
Ask Claude Code to build a small browser game with three.js, starting with plain shapes. Get the camera and movement right, then add models and light. Test on your phone before sharing the link. You can use free 3D tools and free hosting; access to the coding tool costs extra.
- Start with simple shapes
- Choose a camera that feels right
- Test on your phone
Published · Updated
Start buildingHow to make a 3D game with AI
Try Capybara Kart to see a camera follow a racer through turns. You can build towards that kind of game with boxes first, then add art once driving feels good.
These are lessons from our builds. The prompts below are starting points for your own game. The first kart build took about 16 hours, with later changes to its art and controls. Allow time to play and change things; a first draft is only the start.
What makes 3D harder?
In 2D, you usually move pictures across a flat screen. In 3D, objects also have depth. A model is an object's shape, such as a kart or a tree. The camera decides which part of the world you see, and light helps you judge its shape.
Those choices affect play. A wall can hide the player. A low camera can hide the next turn. Fine detail can turn to noise on a small screen, while too many objects make a phone struggle to draw each picture. Start small enough that you can spot which choice caused a problem.
What you need
- Claude Code, with access through your own plan or account. Codex is optional for building or reviewing a change.
- A computer browser and a phone to play on. Install Node.js if the coding tool needs it to run the local preview.
- three.js, the free library that draws 3D in the browser. Ask the tool to set it up.
- Blender, only if you want to make your own models. It's free.
Open an empty project folder in your coding tool. Ask it to save working versions with Git so you can return to one when a change goes wrong.
The steps
Step 1: Pick a small idea that needs depth
In Sinkhole Soi, you steer a hole through a market street. Small objects lead you towards larger ones as the hole grows. The tipping and falling make depth part of the reward.
Choose one action where seeing depth helps: driving around a bend, hiding behind a stall, or watching a chair tip into a hole. Keep the first game to one small place. A large open world gives you more empty space to fill before you know if moving around is fun.
Plan a small 3D browser game where I steer a hole and swallow
smaller street objects to grow. One short round, one street.
Leave online play and shops for later. Give me a short build plan.
You should be able to explain the goal without describing the art. Decide how the player wins or loses. If the plan needs several maps before anyone can play, cut it back.
Step 2: Start your three.js game with simple shapes
Ask for a floor, a movable box and a few obstacles. This rough version is often called a greybox. It lets you change sizes and distances without rebuilding finished art. three.js draws the scene; the coding tool still has to write the movement and game rules.
Make a small three.js game: I steer a hole around one street,
swallowing smaller objects to grow. Use boxes and spheres first.
Add keyboard movement, a round timer, scoring and restart.
Start a local preview and tell me how to open it in my browser.
To try it on your phone, put both devices on the same Wi-Fi. Ask the tool to make the preview available on your local network and give you the phone link. Keep the preview running on your computer while you play.
Play a whole round. You should understand where you can move, notice when you hit something, and restart without reloading. Ask for one fix at a time: "The player slides through that box" gives the tool a smaller job than "make it better."
Capybara Kart kept its simple-shape race as a fallback for when the models fail to load. Its karts use boxes, round heads and cylinder wheels. The same follow camera works with both, so driving doesn't have to wait for finished capybaras.
Step 3: Choose the camera before polishing the world
Capybara Kart's chase camera looks ahead of the kart and eases through heading changes. When you reverse, it keeps looking up the road. A camera that spun around with every change of direction would make parking and recovery harder.
A follow camera sits behind the player and moves with them. It suits racing. A fixed angled view shows the tops and sides of objects, which helps you judge where to move. A top-down view gives you a clear map but shows less height.
Try a follow camera, a fixed angled view and a top-down view.
Keep movement the same so I can compare them. For the follow view,
show space ahead and ease the camera through turns.
Pick the view that makes the next move easiest to read. Drive or walk around an obstacle, stop, then reverse. Watch for sudden swings and places where the player vanishes. Settle on one view before decorating areas the camera may never show.
Step 4: Replace shapes with small models
Free model packs are the quickest route to a matching set of props. For example, Kenney's Racing Kit lists a CC0 licence. That permits commercial use without required credit. Save the pack's licence with your files and check each pack you use.
For a custom character, install Blender and ask the AI to write a script that builds the model from shapes. You can then request changes in words. Try one model inside the game before making a whole set.
We used that route for Capybara Kart's driver, kart and market props. Their colours are stored on the shapes, with no texture images to download. Keeping the scripts means a new hat can be rebuilt the same way as the other art.
Write a Blender script for one simple toy-like character.
Use plain colours and few faces. Export a GLB, a model file the
browser can load. Run it in Blender and explain how to rebuild it.
Replace only the player shape first.
Check it from the game camera. If the feet float, fix that first. Walk through a narrow gap to check the size, then turn around. A detailed face is wasted if it appears as a few dots on a phone.
Step 5: Make light and colour help you play
Hide in Paint lets you paint your character to blend into a wall. An early version drew a check pattern on the character against a striped wall. The paint now lines up with the selected surface, including its pattern and light. Spin the camera around your character to check the disguise.
Start with soft light across the scene and one light that acts like the sun. Give the player and important objects colours you can tell apart. A texture is an image laid over a model; use bold, simple patterns before trying fine surface detail.
Make the player and obstacles clear on a small phone screen.
Use soft light and one sun light. Keep the colours consistent.
Show me one game view before changing all the art.
Look at that view at phone size. Can you find the player at once? Can you tell the floor from a wall and judge where a jump lands? A night scene still needs enough light to play. Add glow and deep shadows after the basic view reads well.
Step 6: Make controls agree with the camera
On a keyboard, arrow keys or WASD are familiar. On a phone, choose buttons or a thumb stick to suit the action. The player should move in the direction they expect on screen, even when the camera looks at the world from an angle.
Add keyboard and touch controls for this camera view.
Keep the player visible above my thumb. Test that left looks left
on screen. Clear held controls when I release or leave the tab.
Try each direction by itself before a full round. Then hold two controls together, lift one finger, and switch away from the browser. Check that the page doesn't scroll during play and that movement stops when it should. Test both ways of holding the phone.
Capybara Kart's first steering passed its checks but turned the wrong way on screen. We fixed the direction and added a check through the camera. Press left and watch where the nose goes in your game too.
Step 7: Keep it fast on a phone
Ask the tool to show FPS, or frames per second, while you test. It counts how many pictures the game draws each second. Watch it in the busiest part of a round on a physical phone, after playing for a while. A laptop with a phone-shaped window can't prove phone speed. We haven't measured our own games' frame rates on a physical phone yet.
Add a temporary FPS display. Help me test the busiest scene on my
phone. Reduce objects, shrink texture images and reuse repeated
models. Lower shadow detail if needed, then compare the same scene.
A steady game feels better than one that slows whenever you turn a corner. Around 30 FPS can suit a quiet game; a fast racer benefits from around 60. Watch for dropped frames even when the average looks good.
In Sinkhole Soi, repeated props share model batches, so the browser can draw many copies together. It also gives small objects fewer shadows and limits drawing detail on dense screens.
Change one thing, then play the same busy scene again. If smaller textures don't help, ask the tool what is taking time before removing more art. Keep a screenshot from before the change so you can judge what you lost.
Step 8: Test a full round, then share
Give someone the preview with no spoken instructions. Watch where they hesitate. Check a fresh load, a finished round and restart, plus a turn past the largest object in the scene. Do that on your phone as well as your computer.
Help me check loading, a full round and restart on phone and keyboard.
Check that scenery never blocks the camera. Fix what fails, then
prepare the finished files for free static hosting.
Bangkok Run views the runner from behind and hides obstacles once they pass him, before they sweep across the lens. A cart you've already dodged shouldn't fill the view and hide the next one. Include awkward camera views in your last play, even if the score and restart work.
Once the round works, the web game guide shows how to put the files on free hosting and share the link.
What it costs
three.js and Blender cost $0 USD. Our games use Vercel for their pages. Their online rooms run on Cloudflare's free plan, which costs $0 USD/month within its limits.
For your small solo game, Cloudflare Pages pricing allows free, unlimited requests for static files, which are files sent without running server functions. You can start at $0 USD/month within the platform's limits. Vercel pricing lists Hobby at $0 USD/month and Pro from $20 USD/month plus extra usage; Hobby is for personal, non-commercial projects.
Cloudflare Workers pricing lists Paid from $5 USD/month plus extra usage. Online rooms have separate limits, covered in the multiplayer guide. Prices as of 20 November 2026. Your coding tool and any custom domain have separate costs.
If something looks off
If the player disappears behind a wall, change the camera or fade that wall. If a model floats or faces sideways, fix its placement before changing the controls. If a phone gets choppy after you add art, compare with the simple-shape version to narrow down the cause.
Tool licences
three.js uses the MIT licence; keep its notice with your game. Blender uses the GPL, which doesn't require the artwork you make in it to use the same licence. Node.js uses the MIT licence. The coding tools have their own access terms.
For a first 2D game, use How to make a web game with AI.
To add online rooms, use How to make a multiplayer game with AI.
The prompts here are free. For Capybara Kart's full 3D project and source files, the kart kit is $39.
Questions people ask
Can AI make a 3D game if I don't know how to code?
A tool such as Claude Code can write the files and help fix bugs. You choose the rules and play each change. Start with one small place and one action, then add art once the game works.
Is three.js a game engine?
three.js draws 3D scenes in a browser. It doesn't supply all the rules, controls or menus of a finished game. Your coding tool can write those parts around it.
Do I need Blender to make a 3D game?
No. You can build with simple shapes or use free model packs with a suitable licence. Blender is free and useful when you want your own models. The AI can write a script that builds them.
What does making a 3D browser game cost?
three.js and Blender are free. Your coding tool has its own access costs. Cloudflare Pages can host a small game made of static files for $0 USD/month, within its limits. Online rooms have separate limits. Pricing read 20 November 2026.
Will a three.js game work on a phone?
It can, with touch controls and a small enough scene. Test a busy round on a physical phone. A desktop browser's phone view helps with layout but doesn't prove how fast the phone will run it.