Skip to content

Editing in VS Code

The in-world editor is fine for one script. Once your world has a dozen, you want the editor you already know — with your keybindings, your extensions and your split panes.

Opening the project

Open in VS Code, on the editor's top bar, writes your whole world to a folder and opens it. Saving a file there applies it to the running game.

The same button lives in the inspector under Scripts, where it opens the project focused on the script you were looking at.

What you get

%LOCALAPPDATA%\Hungrit\projects\<your world>\
├─ scripts\                   ← your game; this is all of it
│  ├─ Front door-7\
│  │  ├─ main.luau
│  │  └─ lock.luau
│  └─ Scenery-3\              ← a group in the scene tree is a folder here
│     └─ Turret-12\
│        └─ main.luau
├─ .hungrit\                 ← generated; never edit in here
│  ├─ types\hungrit.d.luau   ←   the whole API, as declarations
│  └─ project.json            ←   which file is which script of which object
├─ .vscode\settings.json      ← yours; written once, never overwritten
├─ .luaurc                    ← yours
└─ README.md                  ← generated

One folder per object, one file per script. The number in the folder name is the object's id — two objects can share a name, and without the id one would quietly take the other's scripts.

main.luau is the default slot.

Groups are folders. Arrange your world into groups in the scene tree and the project follows the same shape, nesting as deeply as you nested. Move an object into a group in the game and its file moves folder the next time the project is written.

Parts of a linkset are not folders: a part is matter, not a container.

Creating a script from VS Code

A .luau file you create anywhere under scripts/ becomes a script on the object whose folder holds it, the moment you save something into it.

Deleting the file removes the script.

Autocomplete and type checking

The .hungrit/types/hungrit.d.luau file declares the whole API. With luau-lsp installed, you get:

  • autocomplete on self:, world:, players: and the rest
  • the option tables of every call
  • an error on a typo, before you save it into the world

Keep --!strict on the first line of every script — that is what turns the checking on.

Colour and autocomplete are two different things. Syntax colouring comes from whichever Lua or Luau extension you have installed; autocomplete comes from luau-lsp reading the declaration file. Having one without the other is normal and is not a broken setup.

What syncs, and when

You doWhat happens
Save a file in VS Codeapplied to the running game immediately
Change a script in-worldthe file is rewritten
Rename an object in-worldits folder is renamed next time the project is written
Add an object in-worldits folder appears next time the project is written

The project is a view of the world, not a copy you merge back. There is no commit step and no conflict resolution — the world is the truth, and the folder follows it.

Re-opening

Pressing Open in VS Code again on a world you already have a project for re-adopts the existing folder silently, keeping your .vscode/settings.json and your .luaurc exactly as you left them.

Next

Hungrit scripting documentation.