Namespace Unity.Netcode.Components
Classes
AnticipatedNetworkTransform
A subclass of NetworkTransform that supports basic client anticipation - the client can set a value on the belief that the server will update it to reflect the same value in a future update (i.e., as the result of an RPC call). This value can then be adjusted as new updates from the server come in, in three basic modes:
- Snap: In this mode (with StaleDataHandling set to Ignore and no OnReanticipate(double) callback), the moment a more up-to-date value is received from the authority, it will simply replace the anticipated value, resulting in a "snap" to the new value if it is different from the anticipated value.
- Smooth: In this mode (with StaleDataHandling set to Ignore and an OnReanticipate(double) callback that calls Smooth(TransformState, TransformState, float) from the anticipated value to the authority value with an appropriate Lerp(float, float, float)-style smooth function), when a more up-to-date value is received from the authority, it will interpolate over time from an incorrect anticipated value to the correct authoritative value.
- Constant Reanticipation: In this mode (with StaleDataHandling set to Reanticipate and an OnReanticipate(double) that calculates a new anticipated value based on the current authoritative value), when a more up-to-date value is received from the authority, user code calculates a new anticipated value, possibly calling Smooth(TransformState, TransformState, float) to interpolate between the previous anticipation and the new anticipation. This is useful for values that change frequently and need to constantly be re-evaluated, as opposed to values that change only in response to user action and simply need a one-time anticipation when the user performs that action.
Note that these three modes may be combined. For example, if an OnReanticipate(double) callback does not call either Smooth(TransformState, TransformState, float) or one of the Anticipate methods, the result will be a snap to the authoritative value, enabling for a callback that may conditionally call Smooth(TransformState, TransformState, float) when the difference between the anticipated and authoritative values is within some threshold, but fall back to snap behavior if the difference is too large.
NetworkAnimator
NetworkAnimator enables remote synchronization of Animator state for on network objects.
NetworkRigidbody
NetworkRigidbody allows for the use of Rigidbody on network objects. By controlling the kinematic mode of the Rigidbody and disabling it on all peers but the authoritative one.
NetworkRigidbody2D
NetworkRigidbody allows for the use of Rigidbody2D on network objects. By controlling the kinematic mode of the rigidbody and disabling it on all peers but the authoritative one.
NetworkRigidbodyBase
NetworkRigidbodyBase is a unified Rigidbody and Rigidbody2D integration that helps to synchronize physics motion, collision, and interpolation when used with a NetworkTransform.
NetworkTransform
A component for syncing transforms. NetworkTransform will read the underlying transform and replicate it to clients. The replicated value will be automatically be interpolated (if active) and applied to the underlying GameObject's transform.
RigidbodyContactEventManager
Structs
AnticipatedNetworkTransform.TransformState
HalfVector3
Half float precision Vector3.
HalfVector4
Half Precision Vector4 that can also be used to convert a Quaternion to half precision.
NetworkDeltaPosition
Used to synchromnize delta position when half float precision is enabled
NetworkTransform.NetworkTransformState
Data structure used to synchronize the NetworkTransform
Interfaces
IContactEventHandler
Enums
NetworkRigidbodyBase.RigidbodyTypes
Used to define the type of Rigidbody implemented.
NetworkTransform.AuthorityModes
Delegates
NetworkTransform.AddLogEntryHandler
For debugging delta position and half vector3
NetworkTransform.OnClientRequestChangeDelegate
The handler delegate type that takes client requested changes and returns resulting changes handled by the server.