← All namespaces

level

Scene, level & world Core

Open, save, create, and edit maps: streaming, lighting and nav builds, actor lists and bounds.

What it's for

level is the day-to-day "open and edit a map" surface. It covers the whole lifecycle of a map asset: create a new level, load one into the active editor, save it, rename or duplicate it, and import or export it as text. It is the editor-time CRUD layer for the .umap assets your project ships.

Beyond file operations, it handles the parts of a map you build rather than place: static lighting and lightmap bakes, navigation-mesh (recast) builds for AI, and the full "Build All" sequence. Several of these are genuinely long-running and run as background jobs, so your assistant kicks them off and waits instead of blocking.

It also answers questions about a map without your having to click through the editor: list the actors that belong to a specific level, measure the world-space bounds that enclose them, or pull descriptive metadata like package path, owning world, and actor count. And it manages the legacy level-streaming model, adding and removing streaming sublevels and toggling their loaded and visible state.

Reach for level when you are opening, saving, or building maps. For world-partition authoring that sits on top of a map, that lives in the sibling level.structure namespace (data layers, HLOD, level instances, packed-level actors, the level blueprint graph). Note that new maps almost always use world partition, so the sublevel operations here apply mainly to lighting scenarios and to projects that have not migrated.

Examples

Create a map, add a light, and save it

Spin up a fresh non-world-partition level, drop a directional light in, and write it to disk.

You: Make a new map called Arena under /Game/Maps, add a directional light, and save it.

  call("level.create", {levelName:"Arena"})
    → {ok:true, levelPath:"/Game/Maps/Arena"}
  call("level.spawn_light", {lightType:"Directional", rotation:{pitch:-45, yaw:30, roll:0}})
    → {ok:true, actor:"DirectionalLight_0"}
  call("level.save", {})
    → {ok:true}

Done. Created /Game/Maps/Arena with a directional light and saved it.

Open a map and measure its extent

Load a level into the editor, then read the bounding box that encloses every actor in it.

You: Open the test track and tell me how big it is.

  call("level.load", {levelPath:"/Game/Maps/TestTrack"})
    → {ok:true, world:"TestTrack"}
  call("level.get_bounds", {})
    → {origin:{x:0, y:0, z:120}, extent:{x:8000, y:6000, z:450}}

Done. TestTrack spans roughly 160×120×9 m, centered near the origin.

Rebuild navigation after changing geometry

Kick off a recast nav-mesh build for the active world; it runs as a background job.

You: I moved a lot of walls around, rebuild the navmesh so the AI can path again.

  call("level.build_navigation", {})
    → {job:"nav-build-3f2a", status:"running"}
  call("system.job_status", {job:"nav-build-3f2a"})
    → {status:"done", ok:true}

Done. Navigation mesh rebuilt for the active world.

← Back to all namespaces