menu_bookDocumentation

GameObjectSystem: Scene-Level Batch Processing Systems in s&box

calendar_today May 20, 2026 schedule ~1 min read person PatrickJr verified 50

A GameObjectSystem in s&box is a scene-level system that performs work at specific points during the frame. Automatically instantiated when a scene is created — no manual setup needed.

Implementation

CSHARP
public class MyGameSystem : GameObjectSystem
{
    public MyGameSystem( Scene scene ) : base( scene )
    {
        Listen( Stage.PhysicsStep, 10, DoSomething, "DoingSomething" );
    }

    void DoSomething()
    {
        var allThings = Scene.GetAllComponents<MyThing>();
        // process all things in one batch
    }
}

Why Use GameObjectSystems

Faster than per-component OnUpdate() — process all instances in one batch, avoid out-of-order problems, and guarantee timing (e.g., all bone positions updated before anything reads them).

Access

Access via Scene.Get<MyGameSystem>() or inherit from GameObjectSystem<T> for a static Current property:

CSHARP
public class MyGameSystem : GameObjectSystem&lt;MyGameSystem&gt;
{
    public MyGameSystem( Scene scene ) : base( scene ) { }
    public void MyMethod() { Log.Info( "Hello" ); }
}

// Usage:
MyGameSystem.Current.MyMethod();

Stages and Order

Stages correspond to frame events (e.g., Stage.PhysicsStep runs during FixedUpdate). The order parameter (-1 = before, +1 = after) controls execution sequence within a stage.

Configuration

Properties marked with [Property] are configurable in Project Settings under Systems, and saved per-project.

Was this helpful?