Skip to content

Event Bus

The Event Bus provides type-safe pub/sub on top of Godot’s signal architecture. Events are plain C# types — records work well.

public record PlayerDied(string PlayerName, Vector2 Position);
EventBus.Subscribe<PlayerDied>(e =>
{
GD.Print($"{e.PlayerName} died at {e.Position}");
});
EventBus.Publish(new PlayerDied("Hero", GlobalPosition));

Higher priority subscribers run first.

EventBus.Subscribe<PlayerDied>(OnDeath, priority: 10);
EventBus.Unsubscribe<PlayerDied>(handler);