Class 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.
Inherited Members
Namespace: Unity.Netcode.Components
Assembly: Unity.Netcode.Components.dll
Syntax
[RequireComponent(typeof(Rigidbody2D))]
[RequireComponent(typeof(NetworkTransform))]
[AddComponentMenu("Netcode/Network Rigidbody 2D")]
public class NetworkRigidbody2D : NetworkBehaviour
Methods
OnGainedOwnership()
For owner authoritative (i.e. ClientNetworkTransform) we adjust our authority when we gain ownership
Declaration
public override void OnGainedOwnership()
Overrides
OnLostOwnership()
For owner authoritative(i.e. ClientNetworkTransform) we adjust our authority when we have lost ownership
Declaration
public override void OnLostOwnership()
Overrides
OnNetworkDespawn()
Gets called when the Network
Declaration
public override void OnNetworkDespawn()
Overrides
OnNetworkSpawn()
Gets called when the Network
Declaration
public override void OnNetworkSpawn()