s&box
RustCounter-Strike 2s&boxDeadlock
Wiki
Get s&box on Steam
Browse
OverviewGetting StartedCreating GamesEngine & ToolsDocumentationCommunity GamesResources
s&boxDocumentationSceneGameobjectsystem
SOURCE 2 · C#
Build and play games with s&box.

Facepunch's game engine and creation platform — make games in C#, or jump straight into community games.

Get s&box on Steam

s&box Wiki

  • Overview
  • Getting Started
  • Creating Games
  • Engine & Tools
  • Documentation
  • Community Games
  • Resources

Tools & Community

  • Getting Started
  • Creating Games
  • Engine & Tools
  • Resources

Platforms

  • RustBattle
  • CSBattle
  • Rust Game Wiki
  • CS2 Skins Wiki
  • Deadlock Wiki

About

  • Official Site
  • Developer Wiki
  • GitHub
  • Get on Steam
NOT AFFILIATED WITH FACEPUNCH STUDIOS · © 2026 s&box Wiki (community)
Docs/Scene
Scene

GameObjectSystem

A scene can contain systems that need to do work in specific places during the frame.

For example, one of these systems is the SceneAnimationSystem, which finds all SkinnedModelRenderer components and works out all of their animations in parallel. This is faster than doing it in Update() and avoids weird out of order problems. It gives us a single point in the frame where we know for sure that all of the bone positions are up to date.

To create your own system, you just define a new class that derives from GameObjectSystem.

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

	void DoSomething()
	{
		Log.Info( "Did something!" );
  
        var allThings = Scene.GetAllComponents<MyThing>();
        
        // do something to all of the things
	}
}

When a scene is created, a copy of every defined GameObjectSystem is created and added to it, you don't need to do anything else.

You can access a GameObjectSystem in a number of ways. One way is using Scene.Get<MyGameSystem>()

You can also inherit from GameObjectSystem<T> which adds a static T Current property to your system.

public class MyGameSystem : GameObjectSystem<MyGameSystem>
{
  	public MyGameSystem( Scene scene ) : base( scene )
	{
	}
 
    public void MyMethod()
    {
        Log.Info( "Hello, World!" );
    }
}

Then you can use them like…

MyGameSystem.Current.MyMethod();

Stages are based around certain events. For example, the PhysicsStep stage is called when ticking the physics, during FixedUpdate.

The order defines where to call your method during that event. -1 would call it before, +1 would call it after. You will be defining the systems, so getting them in an order you can live with is your business.

GameObjectSystems have two methods of configuration. You can either globally configure them, or edit them per scene.

In Project Settings, hit Systems, and you can configure them there.

:::info Any property marked with [Property] will be configurable in project settings and saved.

:::

Source: Facepunch/sbox-docs (CC-BY-4.0) · updated 2026-02-06. Read it rendered on the official docs.

More in Scene

Advanced Topics
Async
Camera Effects
Component Interfaces
Component Methods
Component Versioning
Components
Events
← All documentation

Community wiki — not affiliated with Facepunch Studios. For the latest and most authoritative information, see the official developer wiki.