Skip to content

en getting started first project

nullus-docs-bot edited this page Oct 14, 2026 · 2 revisions

Your First Project

中文 | English | Docs | Repository

This page takes the shortest path to a running result: create a project, build a scene, add a light, attach a first script, and enter Play. You never have to leave the editor.

Prerequisites

Editor and Launcher are already built, as described in Environment and Build.

1. Create a project

Start the Launcher, choose to create a project, and provide a name, a disk location, and a template. The creation wizard:

  1. Creates the project directory plus Assets/, ProjectSettings/, and UserSettings/.
  2. Copies the selected template's content/ into the project. The built-in Empty Project template lives in App/Assets/Templates/EmptyProject and ships Assets/Scripts/ExampleBehaviour.cs and ExampleBehaviour.lua.
  3. Writes the <Project>.nullus project file.

Library/ is generated the first time the editor opens the project.

<Project>.nullus records startup-time options such as resolution, graphics backend, start scene, and whether threaded rendering is enabled. These are read while the editor and game start and cannot change at runtime. The full key list is in the Project Layout and Command Line reference.

2. Open the editor

Open the new project from the Launcher. The editor opens the last used scene, which is empty on first launch.

Check the status bar and title bar to confirm the active project before making changes, so edits do not land in a different project.

3. Build a scene

  1. Create a GameObject from the Hierarchy.
  2. Confirm in the Inspector that it already carries a TransformComponent.
  3. Add a CameraComponent through the component selector and place the camera near the object.
  4. Add a LightComponent. When using a non-directional light, set Range and OuterCutoff.
  5. Adjust the Transform with the Scene View gizmo until the view makes sense.

If you need geometry, import a model or use GameObject.CreatePrimitive from a script. Import is covered in Models, Meshes, and Textures.

Save the scene. Scenes and Prefabs are stored as reflection-driven object graphs that include hierarchy and component fields; see Reflection and Serialization for the format.

4. Write your first C# script

Create a .cs file under the project's Assets directory deriving from Nullus.Behaviour:

using Nullus;

public sealed class Rotator : Behaviour
{
    private void Awake()
    {
        Debug.Log("Rotator awake");
    }

    private void Update()
    {
        transform.Rotate(Vector3.up * (30.0f * Time.deltaTime));
    }
}

Saving triggers an incremental build through the asset watcher. On success the editor hot reloads at a frame boundary and preserves fields; on failure the previous working assembly keeps running and the error appears in the Console.

Attach the script to the GameObject and press Play. Stopping returns to edit mode.

5. Write your first Lua script

Lua shares the same native object model and API manifest. A script returns a module table and the lifecycle functions are members of that table:

local Module = {}

function Module:Update()
    local position = self.transform.localPosition
    position.x = position.x + Nullus.Time.deltaTime
    self.transform.localPosition = position
end

return Module

Nullus is the global API table exposed by the engine, for example Nullus.Time. Saving a .lua file needs no build step; it takes effect on the next run or reload. See C# versus Lua for the differences.

6. Run and observe

  • Press Play. The Game View shows the runtime output while the Scene View keeps the editing camera.
  • The Console collects script logs and errors.
  • The Profiler panel shows Timeline or Tracy data when the matching build switches are on; see Profiling and Graphics Debugging.

What appeared on disk

Path Contents
Assets/ Source assets and scripts
ProjectSettings/ Project-level settings
UserSettings/ Machine-local settings such as editor-settings.json
Library/ Import results, artifacts, thumbnail cache, and IDE workspace
Library/ScriptApi/ScriptApi.json Merged scripting API manifest

Library/ is rebuildable intermediate data and should not be committed.

Next steps

Nullus Engine

Home

中文

English

Clone this wiki locally