Nebula
Core

NetworkRigidbody

Puts a Unity Rigidbody under the mesh's authority model.

generated from the sources
[RequireComponent(typeof(Rigidbody))]
[DisallowMultipleComponent]
public sealed class NetworkRigidbody : NetworkBehaviour

Puts a Unity Rigidbody under the mesh's authority model. On the worker that owns the entity the body is dynamic and PhysX simulates it; everywhere else (ghosts on neighbouring workers, every client) it is kinematic and follows the owner's state stream. Linear velocity is mirrored into NetworkIdentity.Velocity every tick so remote copies extrapolate and a handover keeps momentum; angular velocity only matters to the next simulating worker, so it travels with the handover alone through NetworkBehaviour.WriteHandoverState. Add it next to the NetworkIdentity of any physics prop.

Properties

Body

public Rigidbody Body { get; }

Methods

OnNetworkSpawn

public override void OnNetworkSpawn();

OnGainedAuthority

public override void OnGainedAuthority();

OnLostAuthority

public override void OnLostAuthority();

NetworkTick

public override void NetworkTick(uint tick, float deltaTime);

WriteHandoverState

public override void WriteHandoverState(NetworkWriter writer);

ReadHandoverState

public override void ReadHandoverState(NetworkReader reader);

SetVelocity

public void SetVelocity(Vector3 linear, Vector3 angular = default);

Authority only: set the body's momentum (e.g. to launch a freshly spawned prop).

On this page