Skip to main content
Creating a game in s&box follows a clear pattern. This page walks you through the core concepts and the order in which to apply them.

Create a project

Open the s&box editor. The project window appears automatically. Click New Game Project and complete the setup wizard to create your first project.

The scene system

s&box uses a scene system as the foundation for all games. It is designed to be easy to pick up while remaining powerful enough for complex projects.

Scenes

A Scene is your game world. Everything that renders and updates at one time lives inside a scene. Scenes are saved as JSON files on disk and load extremely quickly — you can switch between them almost instantly.

GameObjects

A scene contains GameObjects. A GameObject is a world object with a position, rotation, and scale. GameObjects can be arranged in a hierarchy: child GameObjects move relative to their parent.

Components

GameObjects contain Components. A Component provides modular functionality to a GameObject. For example:
  • A ModelRenderer component renders a 3D model.
  • A BoxCollider component makes the object solid and collidable.
You build games in s&box by writing new Components in C# and configuring scenes with GameObjects and Components.

How development works

1

Create a project

Open the editor, click New Game Project, and fill out the wizard. This creates a .sbproj file and a project folder.
2

Open a scene

Your new project starts with an empty scene. Open it from the Asset Browser, or create a new one by right-clicking in the Asset Browser and selecting New Scene.
3

Add GameObjects to the scene

Right-click the scene hierarchy on the left and create GameObjects. Each one represents something in your game world — a player, an enemy, a platform, a light, and so on.
4

Attach Components to GameObjects

Select a GameObject and use the Inspector to add built-in components (like ModelRenderer or Rigidbody) or write your own.
5

Write custom Components

Click Add Component in the Inspector and type a name for your new class. The file opens in Visual Studio. Write your game logic there:
public sealed class MyMovement : Component
{
    protected override void OnUpdate()
    {
        float speed = 100f;
        var direction = new Vector3(
            Input.AnalogMove.x,
            0,
            Input.AnalogMove.y
        );
        WorldPosition += direction * speed * Time.Delta;
    }
}
6

Play and iterate

Press the Play button in the editor to enter play mode. Your changes hot-reload automatically — you can edit code without stopping and restarting play mode in most cases.

Key concepts summary

ConceptDescription
SceneThe game world. A JSON file containing all GameObjects and their state.
GameObjectA world object with position, rotation, and scale. Can have children.
ComponentLogic or functionality attached to a GameObject. Written in C#.
Component.OnUpdate()Called every frame. Use it for per-frame game logic.
Component.OnStart()Called once when the Component first becomes active.
Keep your Components small and focused on a single responsibility. A PlayerMovement component handles movement; a separate PlayerHealth component handles health. This makes your code easier to maintain and reuse.