menu_bookDocumentation

IGameObjectNetworkEvents: Ownership Change and Control Transfer Events

calendar_today May 20, 2026 schedule ~1 min read person PatrickJr verified 50
IGameObjectNetworkEvents lets Components on a networked GameObject react to ownership changes. The events are targeted only at the specific GameObject whose ownership is changing.

Interface

CSHARP
public interface IGameObjectNetworkEvents : ISceneEvent<IGameObjectNetworkEvents>
{
    void NetworkOwnerChanged( Connection newOwner, Connection previousOwner ) { }
    void StartControl() { }
    void StopControl() { }
}

Events

MethodWhen Called
NetworkOwnerChangedOwner of the networked object changes. Provides both new and previous Connection.
StartControlThis client has become the controller (no longer a proxy).
StopControlThis object has become a proxy (controlled by someone else).

Usage Example

CSHARP
public sealed class OwnershipTracker : Component, IGameObjectNetworkEvents
{
    void IGameObjectNetworkEvents.StartControl()
    {
        // We now control this object — enable input handling
        Log.Info( "We took control!" );
    }

    void IGameObjectNetworkEvents.StopControl()
    {
        // Someone else controls this now — disable input
        Log.Info( "Lost control, now a proxy" );
    }

    void IGameObjectNetworkEvents.NetworkOwnerChanged( Connection newOwner, Connection previousOwner )
    {
        Log.Info( $"Owner changed from {previousOwner?.DisplayName} to {newOwner?.DisplayName}" );
    }
}

When to Use

  • Enabling/disabling input handling when ownership transfers
  • Updating UI to reflect who controls an object
  • Triggering effects when a player picks up or drops an object
  • Cleaning up state when losing control of a vehicle or weapon
Was this helpful?