Lua scripting

A 3D game engine you script in Lua, in the browser

Every behaviour in an Airogel game is a Lua script attached to an object or a scene. Open any demo, read the script, change it, run it. No build step, no compiler, no install.

Why Lua

Lua is small, fast and readable, which is why it has been the scripting language of choice in games for decades. In Airogel it is the only language you need: input, physics forces, collision callbacks, animation playback, camera switching, on-screen UI and multiplayer state are all plain Lua calls on a gameObject or scene API. There is nothing to compile and no engine restart; edit a script and press play.

What a script looks like

A script is attached to an object and implements lifecycle callbacks. The engine calls start once, then update every frame with the time step, and fires collision and trigger callbacks when the physics world reports them. Inside those callbacks you read input (keyboard, mouse, gamepad or touch), move the object through its transform or apply forces, play animation clips, and draw HUD elements. The Lua scripting overview covers the callbacks and the core objects; the gameObject API reference lists every signature.

What the API covers

  • Transforms and hierarchy: local and world position, rotation (quaternions), scale, parents and children. See coordinates and transforms.
  • Physics: forces, impulses, velocities, collision and trigger callbacks, raycasts and spatial queries against the physics world. See physics, collisions and triggers.
  • Characters: a character controller with ground state, crouching and jumping, plus the model and animation clips every new character ships with. See characters.
  • Animation: play, blend, pause, reverse and speed up clips, or let locomotion drive itself. See the animation playback API.
  • Cameras: first- and third-person follow modes, eye height, switching the active camera at runtime. See cameras and follow modes.
  • Vehicles, constraints, ragdolls, navigation: wheeled and tracked vehicles, constraint motors, jointed ragdolls, navigation agents and generated tracks. See vehicles, constraints, ragdolls and navigation.
  • Scene scripts and storage: level-wide logic, runtime object creation, scene variables, audio and persistent gameStorage. See scene scripts, variables and storage.
  • Multiplayer: shared state and events across the authority, presentation and prediction runtimes. See multiplayer games.

Scripts you can read today

Every demo was scripted in Lua, and every demo page lists what it was built with. A few that show the range:

  • Timewinder: time scale and a ten-second rewind, written in Lua.
  • SELENE: custom gravity that points at a planet's centre.
  • Night Shift: guard AI and perception cones.
  • Ragdoll Hero: a constraint-based ragdoll steered through its own muscles.
  • Ashen Duel: enemy AI with telegraphed attacks and a dodge window.

You don't have to start from a blank file

The built-in AI assistant writes Lua from a description, and it writes it as ordinary scripts you can open and edit. If you'd rather use your own tool, connect Claude, ChatGPT or Codex over MCP and it can write, test and fix scripts inside the editor. See AI game builder.

Frequently asked

Which Lua version is it?

A standard Lua runtime embedded in the engine, with the engine's own libraries (gameObject, scene, input, multiplayer, gameStorage) exposed as globals. The overview explains what is available and what is sandboxed.

Can I use TypeScript, C# or GDScript instead?

No. Airogel is Lua-only by design, so that every script in every project is readable by every user and by the AI assistant. If you need another language, see how Airogel compares with PlayCanvas (JavaScript) and Godot (GDScript and C#).

How do I debug a script?

Run the scene in the editor and watch the console, or write rule tests for a script and run them. The troubleshooting guide lists the common Lua, animation and physics mistakes and how to spot them.

Free to start. Nothing to install.