menu_bookDocumentation

GameObjectSystem with [Sync] and RPCs: Networked Scene-Level State

calendar_today May 4, 2026 schedule ~1 min read person patrickjr verified 50

GameObjectSystem with [Sync]: Networked Scene-Level State

GameObjectSystem supports [Sync] properties just like components. However, there is a key difference: all [Sync] properties on a GameObjectSystem are always host-controlled — the ControlCondition is always c => c.IsHost, regardless of SyncFlags. This makes GameObjectSystem ideal for authoritative game state that the host manages and broadcasts to all clients.

Example

CSHARP
public class GameStateSystem : GameObjectSystem<GameStateSystem>
{
    [Sync] public int Score { get; set; }
    [Sync] public bool IsGameOver { get; set; }
    [Sync( SyncFlags.Interpolate )] public float TimeRemaining { get; set; }

    public GameStateSystem( Scene scene ) : base( scene ) { }
}

// On host:
GameStateSystem.Current.Score += 10;

// On all clients (read-only):
int score = GameStateSystem.Current.Score;

RPCs on GameObjectSystem

GameObjectSystem also supports [Rpc.Broadcast], [Rpc.Host], and [Rpc.Owner] attributes. For Rpc.Owner on a system, the target is always the host (systems have no owner).
CSHARP
public class GameStateSystem : GameObjectSystem<GameStateSystem>
{
    [Rpc.Host]
    public void RequestStartGame()
    {
        // Only runs on host
        IsGameOver = false;
    }
}

Accessing from Anywhere

CSHARP
// From any component or code
var system = GameStateSystem.Current; // uses Game.ActiveScene
var system = GameStateSystem.Get( someScene );
Was this helpful?