API Reference

A quick-reference guide to all major GONet classes, attributes, configuration options, and constants. Use this page as a lookup while building your multiplayer game.

GONetParticipant

Component

Attached to any GameObject that participates in network synchronization. Identifies the object and its owner across the network.

Properties

GONetIdUnique network identifier assigned at runtime
OwnerAuthorityIdAuthority ID of the owning client or server
IsMineTrue if the local machine owns this participant
IsPositionSyncdWhether position is being synchronized
IsRotationSyncdWhether rotation is being synchronized
CodeGenerationIdIdentifier linking to generated sync code

Constants

GONetId_Unset0 -- default value before assignment
OwnerAuthorityId_Server1023 -- reserved for server-owned objects
GONET_ID_BIT_COUNT_USED22 bits -- supports up to ~4 million objects
OWNER_AUTHORITY_ID_BIT_COUNT_USED10 bits -- supports up to 1023 clients

GONetAutoMagicalSync

Attribute

Marks a field or property for automatic network synchronization. Supports quantization, blending, velocity sync, and reliability configuration. Limit: 256 synced members per GONetParticipant.

Properties

SettingsProfileTemplateNameName of a reusable sync profile template
SyncChangesEverySecondsHow often changes are sent (in seconds)
ReliabilityReliable or unreliable delivery
ShouldBlendBetweenValuesReceivedEnable smooth interpolation on receivers
ProcessingPriorityPriority order for processing sync updates
QuantizeDownToBitCountNumber of bits to quantize to (e.g., 16, 8)
QuantizeLowerBoundMinimum value of the quantization range
QuantizeUpperBoundMaximum value of the quantization range
IsVelocityEligibleEnable velocity-augmented sync for this value
PhysicsUpdateIntervalInterval for physics-based sync updates
EnablePhysicsSnappingSnap to exact values on physics updates

Supported Types

bool, byte, sbyte, short, ushort, int, uint, long, ulong, float, double, Vector2, Vector3, Vector4, Quaternion

GONetBehaviour

Base Class

Base class providing GONet lifecycle hooks and access to core systems. Extend this for scripts that need network awareness without being tied to a specific GONetParticipant.

Lifecycle Methods

OnGONetClientVsServerStatusKnownCalled when the local role (client or server) is determined
OnGONetParticipantEnabledCalled when the associated participant is enabled
OnGONetParticipantStartedCalled when the associated participant starts
OnGONetParticipantDeserializeInitAllCompletedCalled after all initial state has been deserialized
OnGONetReadyCalled when the participant is fully initialized and ready for networking
OnGONetParticipantDisabledCalled when the associated participant is disabled

Update Methods

UpdateAfterGONetReadyEfficient per-frame update, batched internally
FixedUpdateAfterGONetReadyFixed timestep update, batched internally
LateUpdateAfterGONetReadyLate update, batched internally

Properties

IsServerTrue if running as the server
IsClientTrue if running as a client
EventBusAccess to the GONet event system
SceneManagerAccess to the GONet scene manager

GONetParticipantCompanionBehaviour

extends GONetBehaviour

A GONetBehaviour that automatically binds to the GONetParticipant on the same GameObject. Use this as the base class for most networked gameplay scripts.

Properties

IsMineTrue if the local machine owns the associated participant
GONetParticipantReference to the associated GONetParticipant component
WasAddedAtRuntimeTrue if this component was added dynamically
IsReadyForGONetOperationsTrue if networking is initialized and ready

Methods

CallRpcInvoke a remote procedure call (0-8 parameters)
CallRpcAsyncInvoke an RPC with async/await support (0-8 parameters)
SetAnimatorTriggerNetwork-synchronized animator trigger
ResetAnimatorTriggerNetwork-synchronized animator trigger reset
ValidateOnGONetReadyPreconditionsOverride to add custom readiness checks

GONetMain

Static

The central static class for all GONet operations. Use it to instantiate objects, access the event bus, query authority, and manage the network lifecycle.

Properties

GlobalReference to the GONetGlobal singleton configuration
SceneManagerAccess to server-authoritative scene management
EventBusPublish and subscribe to network events
IsServerTrue if the local instance is the server
IsClientTrue if the local instance is a client
MyAuthorityIdThe local authority ID (ushort)
gonetServerReference to the server instance (null on clients)
GONetClientReference to the client instance (null on server)

Methods

InstantiateNetwork-aware object instantiation (replicated to all clients)
DespawnGONetParticipantRemove a networked object across all clients
DestroyImmediateImmediately destroy a networked object
TryGetGONetParticipantByGONetIdLook up a participant by its network ID
ReparentGameObjectNetwork-synchronized reparenting
SendBytesToRemoteConnectionSend raw bytes to a specific remote connection
SendBytesToAllRemoteConnectionsBroadcast raw bytes to all remote connections

Diagnostics

EnableDetailedReliableTransportLoggingToggle verbose reliable transport logs
EnableSceneLoadCompleteTracingToggle scene load completion trace logs

GONetLocal

Per-Authority

Per-authority state lookup. Each connected authority (client or server) has a GONetLocal instance indexed by its authority ID.

Static Members

LookupByAuthorityId[ushort]Retrieve the GONetLocal instance for a given authority ID

Methods

GetAllKeys()Returns all authority IDs with active GONetLocal instances

GONetSceneManager

Scene Management

Server-authoritative scene loading and unloading. Supports Build Settings scenes and Unity Addressables with automatic late-joiner synchronization.

Methods

LoadSceneFromBuildSettingsLoad a scene registered in Build Settings
LoadSceneFromAddressablesLoad a scene via Unity Addressables
UnloadSceneUnload an additively-loaded scene
RequestLoadSceneClient-side request to load a scene (requires server approval)
IsSceneLoadingCheck if a specific scene is currently loading
GetCurrentSceneGet the name of the currently active scene
GetLoadingScenesGet all scenes currently in the loading state

Events

OnValidateSceneLoadServer-side hook to approve or deny client scene load requests

RPC Attributes

Attributes

Attributes for declaring remote procedure calls. Applied to methods on GONetParticipantCompanionBehaviour subclasses.

ServerRpc

Called by a client, executed on the server.

IsMineRequiredOnly the owner can invoke this RPC
IsReliableGuarantee delivery (default: true)
IsPersistentReplay for late-joining clients
RunLocallyAlso execute on the calling client

ClientRpc

Called by the server, executed on all clients.

IsReliableGuarantee delivery (default: true)
IsPersistentReplay for late-joining clients

TargetRpc

Called by the server, executed on a specific target.

RpcTargetOwner, Others, All, SpecificAuthority

Common (all RPC types)

ProcessingPriorityPriority order for RPC processing
ValidationHandlerTypeCustom server-side validation handler type

GONetConfig

Static Settings

Global configuration constants for RPC behavior, reparenting limits, and validation. These are compile-time or startup-time settings.

RPC Settings

RpcDeferralTimeoutSecondsSeconds before a deferred RPC times out (default: 5)
MaxDeferredRpcsPerParticipantMax queued RPCs per participant (default: 100)
ThrowOnInvalidRpcThrow an exception on invalid RPC calls
EnableRpcPreSendValidationValidate RPC parameters before sending
EnableRpcDeferralForUnknownParticipantsQueue RPCs for participants not yet known

Reparenting Settings

PendingReparentTimeoutSecondsSeconds before a pending reparent times out (default: 30)
MaxReparentsPerSecondPerAuthorityRate limit for reparenting operations (default: 10)

Validation Settings

ThrowOnGONetReadyViolationsThrow if networking operations are called before ready
EnableOnGONetReadyValidationEnable runtime checks for GONetReady preconditions

Event Interfaces

Interfaces

Interfaces for GONet's event system. Implement these on your custom event types to control delivery behavior, persistence, and cancellation.

Core Interfaces

IGONetEventBase interface. Provides OccurredAtElapsedTicks for event timing.
ITransientEventOne-shot event. IsSingularRecipientOnly controls whether it goes to one or many subscribers.
IPersistentEventReplayed for late-joining clients. No additional members beyond IGONetEvent.
ICancelOutOtherEventsCancels other events. OtherEventTypesCancelledOut lists types; DoesCancelOutOtherEvent provides custom logic.
ILocalOnlyPublishMarker interface. Events with this are never sent over the network.
IGONetPoolResettableFor pooled events. ResetForPoolBorrow and ResetForPoolReturn clear state between uses.
API Reference | GONet Docs