Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.
NetworkBehaviour.OnSynchronize
which is invoked during the initial NetworkObject
synchronization process. This provides users the ability to include custom serialization information that will be applied to the NetworkBehaviour
prior to the NetworkObject
being spawned. (#2298)NetworkObject
auto-add helper and Multiplayer Tools install reminder settings to Project Settings. (#2285)public string DisconnectReason
getter to NetworkManager
and string Reason
to ConnectionApprovalResponse
. Allows connection approval to communicate back a reason. Also added public void DisconnectClient(ulong clientId, string reason)
allowing setting a disconnection reason, when explicitly disconnecting a client. (#2280)XXHash
(32 & 64) implementation with an in-house reimplementation (#2310)NetworkConfig.EnsureNetworkVariableLengthSafety
is disabled NetworkVariable
fields do not write the additional ushort
size value (which helps to reduce the total synchronization message size), but when enabled it still writes the additional ushort
value. (#2298)NetworkTransform
components nested under a parent with a NetworkObject
component (i.e. network prefab) would not have their associated GameObject
's transform synchronized. (#2298)NetworkObject
s that failed to instantiate could cause the entire synchronization pipeline to be disrupted/halted for a connecting client. (#2298)NetworkObject
s nested under a GameObject
would be added to the orphaned children list causing continual console warning log messages. (#2298)UnityTransport
where an error would be logged if the 'Use Encryption' flag was enabled with a Relay configuration that used a secure protocol. (#2289)NetworkObjects
were not honoring the AutoObjectParentSync
property. (#2281)NetworkManager.OnClientConnectedCallback
was being invoked before in-scene placed NetworkObject
s had been spawned when starting NetworkManager
as a host. (#2277)FastBufferReader
with Allocator.None
will not result in extra memory being allocated for the buffer (since it's owned externally in that scenario). (#2265)NetworkObject
auto-add and Multiplayer Tools install reminder settings from the Menu interface. (#2285)NetworkManager.IsApproved
flag that is set to true
a client has been approved.(#2261)UnityTransport
now provides a way to set the Relay server data directly from the RelayServerData
structure (provided by the Unity Transport package) throuh its SetRelayServerData
method. This allows making use of the new APIs in UTP 1.3 that simplify integration of the Relay SDK. (#2235)UnityTransport
. (#2232)UseWebSockets
property in the UnityTransport
component of the NetworkManager
allowing to pick WebSockets for communication. When building for WebGL, this selection happens automatically. (#2201)ParentSyncMessage
which provides users the ability to specify the final values on the server-side when OnNetworkObjectParentChanged
is invoked just before the message is created (when the Transform
values are applied to the message). (#2146)NetworkObject.TryRemoveParent
method for convenience purposes opposed to having to cast null to either GameObject
or NetworkObject
. (#2146)UnityTransport
dependency on com.unity.transport
to 1.3.0. (#2231)UnityTransport
are now dynamically-sized. This means that there shouldn't be any need anymore to tweak the 'Max Send Queue Size' value. In fact, this field is now removed from the inspector and will not be serialized anymore. It is still possible to set it manually using the MaxSendQueueSize
property, but it is not recommended to do so aside from some specific needs (e.g. limiting the amount of memory used by the send queues in very constrained environments). (#2212)UnityTransport.InitialMaxSendQueueSize
field is now deprecated. There is no default value anymore since send queues are dynamically-sized. (#2212)UnityTransport
is now non-deterministic. Its random number generator used to be seeded with a constant value, leading to the same pattern of packet drops, delays, and jitter in every run. (#2196)NetworkVariable<>
now supports managed INetworkSerializable
types, as well as other managed types with serialization/deserialization delegates registered to UserNetworkVariableSerialization<T>.WriteValue
and UserNetworkVariableSerialization<T>.ReadValue
(#2219)NetworkVariable<>
and BufferSerializer<BufferSerializerReader>
now deserialize INetworkSerializable
types in-place, rather than constructing new ones. (#2219)NetworkManager.ApprovalTimeout
will not timeout due to slower client synchronization times as it now uses the added NetworkManager.IsApproved
flag to determined if the client has been approved or not.(#2261)NetworkConfig
hash value for each unique connection request. (#2226)DontDestroyWithOwner
property into consideration when a client disconnected. (#2225)SceneEventProgress
would not complete if a client late joins while it is still in progress. (#2222)SceneEventProgress
would not complete if a client disconnects. (#2222)SceneEventProgress
has timed out. (#2222)UnityTransport
would fail to restart after a first failure (even if what caused the initial failure was addressed). (#2220)NetworkTransform.SetStateServerRpc
and NetworkTransform.SetStateClientRpc
were not honoring local vs world space settings when applying the position and rotation. (#2203)TypeLoadException
on WebGL on MacOS Editor and potentially other platforms. (#2199)WorldPositionStays
parenting parameter was not being synchronized with clients. (#2146)NetworkObject
s would fail for late joining clients. (#2146)WorldPositionStays
was true. (#2146)NetworkTransform.ApplyTransformToNetworkStateWithInfo
where it was not honoring axis sync settings when NetworkTransformState.IsTeleportingNextFrame
was true. (#2146)NetworkTransform.TryCommitTransformToServer
where it was not honoring the InLocalSpace
setting. (#2146)ClientRpcParams
. (#2144)FastBufferReader
and FastBufferWriter
when the parameters were a generic type (i.e., ListOnNetworkUpdate
causing other OnNetworkUpdate
calls to not be executed. (#1739)NetworkTransform
was not honoring the InLocalSpace property on the authority side during OnNetworkSpawn. (#2170)NetworkTransform
was not ending extrapolation for the previous state causing non-authoritative instances to become out of synch. (#2170)NetworkTransform
was not continuing to interpolate for the remainder of the associated tick period. (#2170)NetworkTransform.OnNetworkSpawn
for non-authoritative instances where it was initializing interpolators with the replicated network state which now only contains the transform deltas that occurred during a network tick and not the entire transform state. (#2170)com.unity.transport
to 1.2.0. (#2129)UnityTransport
, reliable payloads are now allowed to exceed the configured 'Max Payload Size'. Unreliable payloads remain bounded by this setting. (#2081)NetworkTransformState.m_Bitset
flag not getting cleared upon the next tick advancement. (#2110)NetworkTransform.Teleport
. (#2110)NetworkVariable
with both owner read and write permissions would not update the server side when changed. (#2097)GameObject
, with NetworkObject
component attached, that has one or more child GameObject
s, that are inactive in the hierarchy, with NetworkBehaviour
components it will no longer attempt to spawn the associated NetworkBehaviour
(s) or invoke ownership changed notifications but will log a warning message. (#2096)NetworkObject.NetworkHide
was despawning and destroying, as opposed to only despawning, in-scene placed NetworkObject
s. (#2086)NetworkAnimator
synchronizing transitions twice due to it detecting the change in animation state once a transition is started by a trigger. (#2084)NetworkAnimator
would not synchronize a looping animation for late joining clients if it was at the very end of its loop. (#2076)NetworkAnimator
was not removing its subscription from OnClientConnectedCallback
when despawned during the shutdown sequence. (#2074)com.unity.transport
to 1.2.0. (#2129)UnityTransport
, reliable payloads are now allowed to exceed the configured 'Max Payload Size'. Unreliable payloads remain bounded by this setting. (#2081)NetworkTransformState.m_Bitset
flag not getting cleared upon the next tick advancement. (#2110)NetworkTransform.Teleport
. (#2110)NetworkVariable
with both owner read and write permissions would not update the server side when changed. (#2097)GameObject
, with NetworkObject
component attached, that has one or more child GameObject
s, that are inactive in the hierarchy, with NetworkBehaviour
components it will no longer attempt to spawn the associated NetworkBehaviour
(s) or invoke ownership changed notifications but will log a warning message. (#2096)NetworkObject.NetworkHide
was despawning and destroying, as opposed to only despawning, in-scene placed NetworkObject
s. (#2086)NetworkAnimator
synchronizing transitions twice due to it detecting the change in animation state once a transition is started by a trigger. (#2084)NetworkAnimator
would not synchronize a looping animation for late joining clients if it was at the very end of its loop. (#2076)NetworkAnimator
was not removing its subscription from OnClientConnectedCallback
when despawned during the shutdown sequence. (#2074)OnTransportFailure
callback to NetworkManager
. This callback is invoked when the manager's NetworkTransport
encounters an unrecoverable error. Transport failures also cause the NetworkManager
to shut down. Currently, this is only used by UnityTransport
to signal a timeout of its connection to the Unity Relay servers. (#1994)NetworkEvent.TransportFailure
, which can be used by implementations of NetworkTransport
to signal to NetworkManager
that an unrecoverable error was encountered. (#1994)NetworkManager.RemoveNetworkPrefab(...)
to remove a prefab from the prefabs list (#1950)UnityTransport
dependency on com.unity.transport
to 1.1.0. (#2025)ConnectionApprovalCallback
is no longer an event
and will not allow more than 1 handler registered at a time. Also, ConnectionApprovalCallback
is now an Action<>
taking a ConnectionApprovalRequest
and a ConnectionApprovalResponse
that the client code must fill (#1972) (#2002)NetworkObject
s could throw an exception if the scene of origin handle was zero (0) and the NetworkObject
was already spawned. (#2017)NetworkObject.Observers
was not being cleared when despawned. (#2009)NetworkAnimator
could not run in the server authoritative mode. (#2003)NetworkObject
. (#1985)NetworkBehaviourReference
would throw a type cast exception if using NetworkBehaviourReference.TryGet
and the component type was not found. (#1984)NetworkSceneManager
was not sending scene event notifications for the currently active scene and any additively loaded scenes when loading a new scene in LoadSceneMode.Single
mode. (#1975)LoadEventCompleted
or UnloadEventCompleted
to wait until the NetworkConfig.LoadSceneTimeOut
period before being triggered. (#1973)ConnectionApprovalCallback
s were registered (#1972)FixedString
, Vector2Int
, and Vector3Int
types can now be used in NetworkVariables and RPCs again without requiring a ForceNetworkSerializeByMemcpy<>
wrapper. (#1961)NetworkBehaviour
to a NetworkManager
or vice-versa. (#1947)NetworkAnimator
issue where it was only synchronizing parameters if the layer or state changed or was transitioning between states. (#1946)NetworkAnimator
issue where when it did detect a parameter had changed it would send all parameters as opposed to only the parameters that changed. (#1946)NetworkAnimator
issue where it was not always disposing the NativeArray
that is allocated when spawned. (#1946)NetworkAnimator
issue where it was not taking the animation speed or state speed multiplier into consideration. (#1946)NetworkAnimator
issue where it was not properly synchronizing late joining clients if they joined while Animator
was transitioning between states. (#1946)NetworkAnimator
issue where the server was not relaying changes to non-owner clients when a client was the owner. (#1946)PacketLoss
metric for tools would return the packet loss over a connection lifetime instead of a single frame. (#2004)unmanaged
structs are no longer universally accepted as RPC parameters because some structs (i.e., structs with pointers in them, such as NativeList<T>
) can't be supported by the default memcpy struct serializer. Structs that are intended to be serialized across the network must add INetworkSerializeByMemcpy
to the interface list (i.e., struct Foo : INetworkSerializeByMemcpy
). This interface is empty and just serves to mark the struct as compatible with memcpy serialization. For external structs you can't edit, you can pass them to RPCs by wrapping them in ForceNetworkSerializeByMemcpy<T>
. (#1901)Removed SIPTransport
(#1870)
Removed ClientNetworkTransform
from the package samples and moved to Boss Room's Utilities package which can be found here.
NetworkTransform
generating false positive rotation delta checks when rolling over between 0 and 360 degrees. (#1890)NetworkEvent.Disconnect
event and is using UTP. (#1884)Shutdown
on a NetworkManager
that was already shut down would cause an immediate shutdown the next time it was started (basically the fix makes Shutdown
idempotent). (#1877)UnityTransport
implementation and com.unity.transport
package dependency (#1823)NetworkVariableWritePermission
to NetworkVariableBase
and implemented Owner
client writable netvars. (#1762)UnityTransport
settings can now be set programmatically. (#1845)FastBufferWriter
and Reader IsInitialized property. (#1859)UnityTransport
dependency on com.unity.transport
to 1.0.0 (#1849)SnapshotSystem
(#1852)com.unity.modules.animation
, com.unity.modules.physics
and com.unity.modules.physics2d
dependencies from the package (#1812)com.unity.collections
dependency from the package (#1849)UnityTransport
send queues were not flushed when calling DisconnectLocalClient
or DisconnectRemoteClient
. (#1847)