How We Used ChatGPT to Build a Unity WebGL Game: Our Real Experience

AI tools can generate code, explain errors and produce artwork, but can they help create a complete Unity game?

To find out, we used ChatGPT as a development assistant while creating Skybound, an original fantasy flying game for Lalo Games. We did not limit the experiment to requesting one script or following a short tutorial. We started with a clean Unity project and worked toward a complete playable game containing controls, physics, procedural obstacles, menus, scoring, saving, music and visual effects.

The experiment produced a working game, but it also created visual problems, Unity warnings and features that needed another development pass.

This is our honest experience of using ChatGPT to build a Unity WebGL game—including what worked, what failed and why human testing remained essential.

You can play Skybound online on Lalo Games and experience the result directly in your browser.

Why we decided to build a Unity game with ChatGPT

We wanted to test whether ChatGPT could support the complete process of creating a small Unity game—not merely generate disconnected pieces of code.

The project needed to:

  • Be easy for players to understand
  • Work with keyboard, mouse and touchscreen controls
  • Be suitable for Unity WebGL
  • Include menus, sound and visual effects
  • Track the player’s score
  • Save the best score locally
  • Have an original Lalo Games identity
  • Remain small enough to test and improve quickly

We deliberately chose a simple endless-game structure. Starting with an overly ambitious project would have made it difficult to evaluate what ChatGPT could genuinely do well.

Our intention was not to prove that AI could replace a developer. We wanted to understand whether it could accelerate prototyping and how much human work would still be required to achieve a polished result.

Describing the Skybound concept

We began with a familiar one-action flying mechanic. The player controls a character affected by gravity and must flap upward to avoid obstacles.

However, we did not want to reproduce another game’s visual identity. We directed the project toward an original fantasy presentation containing:

  • A magical winged creature
  • Ancient rune pillars
  • Floating islands and ruins
  • A kingdom above the clouds
  • Turquoise and golden magical effects
  • Fantasy music and sound effects
  • Gradually increasing gameplay speed
  • Lalo Games branding

The resulting concept became Skybound. Players click, tap or use a supported keyboard key to control the creature’s height. Each successfully passed gate awards one point, while colliding with a pillar ends the run.

Providing a clear direction was important. ChatGPT could help implement the project, but it first needed a defined objective, platform and visual style.

How ChatGPT helped create the Unity project

We provided ChatGPT with a clean Unity 6 Universal 2D project. It reviewed the project structure, Unity version, installed packages, rendering setup and WebGL configuration.

The main gameplay was implemented in:

Assets/Scripts/SkyboundGame.cs

This script creates most of the game at runtime. ChatGPT helped develop systems for:

  • Game-state management
  • Player physics
  • Keyboard, mouse and touch input
  • Procedural obstacle generation
  • Collision detection
  • Scoring
  • Difficulty progression
  • Best-score saving
  • Menus and interface panels
  • Pausing and restarting
  • Sound settings
  • Camera responsiveness
  • Background fitting
  • Particle effects
  • Character trails
  • Camera shake
  • Runtime-generated music and sounds

The game contains four principal states: Menu, Playing, Paused and Game Over.

When the Unity scene loads, a runtime initialization method creates the main controller automatically. That controller then builds the player, game world, interface and supporting systems.

This approach allowed us to reach a playable prototype quickly without manually constructing every object and panel inside the Unity Editor.

How ChatGPT supported the visual direction

ChatGPT’s image-generation capability also helped create the three principal game assets:

  • The fantasy-sky background
  • The magical flying creature
  • The rune pillar

We described the style, colors, atmosphere and gameplay requirements. Clear silhouettes were important because both the player and obstacles needed to remain easy to recognize during movement.

The images were imported into Unity as sprites and optimized according to their purpose. The background uses a larger maximum texture size than the character and pillar, while mipmaps were disabled and compression was enabled.

AI accelerated visual exploration, but we still had to select the artwork that suited the game and evaluate how it looked after being placed inside Unity.

An attractive standalone image does not automatically function correctly as a game asset. We discovered that clearly while working on the background.

What worked in the first playable version

The initial version successfully delivered the complete basic gameplay loop.

Players could:

  • Start from the main menu
  • Flap using a click, tap, Spacebar or Up Arrow
  • Fly through randomized rune gates
  • Earn points
  • Experience increasing speed
  • Collide with obstacles
  • Reach a game-over screen
  • Restart the game
  • Pause and resume a run
  • Enable or disable sound
  • Save a local best score

The generated project was therefore more than a collection of code samples. It was a playable game with a beginning, active gameplay loop and ending state.

The runtime construction also worked. Entering Play Mode generated the player, obstacles, UI, effects and audio without requiring us to assemble the entire game manually.

This was where ChatGPT delivered the greatest benefit: it created a broad working foundation quickly.

But “playable” did not mean “finished.”

What failed during the first version

Testing revealed several important problems:

  1. The background appeared divided in the center.
  2. Flap particles appeared as bright pink squares.
  3. Unity displayed a repeated ParticleSystem warning.
  4. The first music loop was too subtle.
  5. The game needed clearer Lalo Games ownership.

These issues demonstrate the difference between code that appears reasonable and a game that actually looks and feels correct.

ChatGPT could inspect and generate the implementation, but it could not decide that the background looked bad or that the music was too weak without receiving feedback from someone testing the game.

The divided-background problem

The first version attempted to create a moving environment using two copies of the fantasy background.

Using repeated backgrounds is a common technique, but it only works correctly when the artwork is designed for seamless repetition. Our generated background contained different clouds, lighting, islands and structures along its two sides.

When two copies were positioned next to each other, their boundary produced an obvious vertical division. The code was moving the images as intended, but the source artwork was not suitable for looping.

We decided not to hide the problem with small positional adjustments. Instead, we changed the design.

The improved version uses one complete background image. A dedicated fitting method measures the camera’s visible width and height and scales the background until it covers the complete screen.

This removed the center seam and preserved the fantasy illustration as one coherent environment.

The experience taught us that AI-generated artwork must still be evaluated as a functional game asset. A beautiful background is not necessarily a seamless background.

[Add before-and-after screenshots of the divided and corrected background.]

Why the particles appeared as pink squares

The flap particles were supposed to appear as small magical glows. Instead, the first version produced bright pink squares.

In Unity, pink or magenta visuals commonly indicate a missing or unsuitable material or shader. The particle system was emitting correctly, but its renderer did not have the right texture and material.

This problem could not be judged by reading the particle code alone. We had to run the game and see the incorrect result.

To repair it, the improved version creates a small radial glow texture through C#. The center is visible, and the transparency gradually fades toward the edges. That texture is assigned to a cached material using Unity’s sprite shader.

The particle renderer now uses this material explicitly, producing soft turquoise and golden bursts instead of pink squares.

This was an effective solution because it corrected the problem without requiring another imported texture.

Fixing the repeated ParticleSystem warning

The first version also generated the following Unity Console warning whenever a flap burst appeared:

Setting the duration while system is still playing is not supported.

The issue originated from the order in which the particle system was configured.

A newly created ParticleSystem may already be playing. The original implementation attempted to change its duration immediately after creation, which Unity does not support while the system is active.

After we shared the exact warning, ChatGPT identified the cause and changed the process:

  1. Create the particle system.
  2. Stop and clear it.
  3. Configure its duration and other properties.
  4. Assign the material.
  5. Start the system.
  6. Emit the requested particles.

The warning disappeared after the configuration order was corrected.

This was one of the clearest examples of AI being useful for focused debugging. A vague statement such as “the particles are broken” would not have provided enough information. Sharing the exact warning and the circumstances that triggered it led to a much more precise solution.

Improving the game through specific feedback

The second version was not created by simply asking ChatGPT to “make the game better.”

We tested the first version and reported specific problems with screenshots, descriptions and the exact Unity Console message.

That feedback produced several targeted improvements:

  • Two backgrounds were replaced with one fitted image.
  • Pink square particles were replaced with soft magical glows.
  • The ParticleSystem warning was removed.
  • The background music became clearer and longer.
  • The opening menu received an “Original Game by Lalo.games” credit.
  • Flap feedback became more visually consistent.

The quality improved because the feedback was concrete.

This became one of our main lessons: AI-assisted development works better as an iterative conversation than as a one-prompt production method.

Where ChatGPT saved development time

ChatGPT accelerated several areas of the project.

Project inspection

It reviewed the project settings, installed packages, Unity version, rendering pipeline and WebGL configuration without requiring us to manually describe every file.

Gameplay programming

It created a working foundation for physics, obstacles, scoring, collisions, difficulty and saving.

Interface construction

It helped generate the main menu, score display, pause panel, sound controls and game-over screen.

Visual exploration

It helped establish the fantasy direction and generate the main artwork.

Debugging

It responded effectively after receiving exact errors and test results.

WebGL preparation

It helped configure compression, caching, texture limits, responsive controls and a lightweight rendering setup.

The biggest time saving was not receiving a flawless finished product. It was reaching a playable starting point quickly and making focused revisions without rebuilding the project from the beginning.

Why Unity knowledge was still necessary

ChatGPT did not remove the need to understand Unity.

A developer still needed to evaluate:

  • Whether the physics felt fair
  • Whether the colliders matched the artwork
  • Why Unity displayed objects in magenta
  • Whether the particle effect suited the fantasy style
  • Why a non-seamless image could not loop correctly
  • Whether the UI responded well to different screen sizes
  • Whether WebGL settings matched the hosting environment
  • Whether the music was noticeable but not distracting
  • Whether proposed fixes were maintainable

ChatGPT could suggest and implement changes, but it could not experience the gameplay for us.

We still had to open the project, wait for Unity to import the assets, enter Play Mode, inspect the result, read the Console and decide what required another revision.

Human judgment was particularly important for visual quality. Code may be technically correct while the resulting effect still looks unfinished.

What ChatGPT could not replace

ChatGPT could generate alternatives, but it could not independently make our creative decisions.

We determined:

  • The scope of the experiment
  • The main gameplay mechanic
  • WebGL as the intended platform
  • The fantasy art direction
  • Which generated assets suited the game
  • Whether the movement felt acceptable
  • Which visible problems mattered most
  • Whether the music needed improvement
  • How prominent the Lalo Games identity should be
  • When another development pass was necessary

Final browser testing also depends on real devices, browsers and hosting conditions. Reading project files cannot confirm how audio, memory, compression, resizing or fullscreen behavior will perform in every environment.

These areas require manual building, deployment and testing.

Our honest opinion about AI-assisted game development

Our experience with ChatGPT was positive, but not because it produced a perfect game on its first attempt.

It successfully helped us:

  • Move from concept to playable prototype
  • Build the main C# systems
  • Generate original visual assets
  • Construct repetitive interface elements
  • Investigate technical warnings
  • Make targeted revisions
  • Prepare the project for WebGL

At the same time, the first version contained a visibly divided background, broken-looking particles, a repeated Unity warning and music that required improvement.

The experiment showed us that ChatGPT is most valuable as a fast development assistant—not an autonomous replacement for a game developer.

Its output becomes more useful when the developer can define the objective clearly, inspect the implementation, test the result and explain exactly what must change.

Final thoughts

We did not request one Unity script and consider the experiment complete.

We began with a clean project, used ChatGPT to create a playable version, tested that version, identified real problems and completed another improvement pass based on practical feedback.

That process provided a more realistic understanding of building a Unity game with ChatGPT.

AI reduced the time required to prototype systems, explore artwork and investigate bugs. However, the quality of Skybound still depended on testing, technical knowledge, creative direction and human decisions.

The best results came from combining AI speed with an iterative development process:

Define the idea, build the prototype, test the result, identify precise problems, improve the implementation and test again.

That is the workflow we would use for another AI-assisted Unity project.

You can play Skybound on Lalo Games and see the final result of the experiment.

Frequently asked questions

Can ChatGPT build a complete Unity game?

ChatGPT can help generate many of the systems required for a complete game, but the project still needs human direction, Unity testing, debugging and creative evaluation.

Did ChatGPT create Skybound automatically?

No. ChatGPT assisted with programming, troubleshooting and visual generation. Lalo Games directed the concept, tested each version, identified problems and determined the necessary improvements.

What version of Unity was used?

Skybound was developed using Unity 6000.3.15f1 with C# and the Universal Render Pipeline’s 2D Renderer.

What problems appeared in the first version?

The first version contained a divided background, magenta particle squares, a repeated ParticleSystem warning and background music that needed improvement.

Can Skybound be played online?

Yes. You can play Skybound directly on Lalo Games using a compatible browser.

Leave a Reply

Your email address will not be published. Required fields are marked *