Nebula
Protocol

EntitySpawnMsg

Full description of an entity.

generated from the sources
public struct EntitySpawnMsg

Full description of an entity. Sent as EntitySpawn (to gateway/clients), GhostSpawn (to a neighbour worker) and as the payload of AuthorityTransfer. Receivers treat a spawn for a known netId as an update (owner/epoch/container/vars), never as a duplicate instantiation.

Fields

NetId

public ulong NetId;

PrefabId

public ushort PrefabId;

OwnerClientId

public uint OwnerClientId;

ContainerIndex

public ushort ContainerIndex;

Epoch

public uint Epoch;

OwnerWorkerIndex

public ushort OwnerWorkerIndex;

LocalPosition

public Vector3 LocalPosition;

LocalRotation

public Quaternion LocalRotation;

Velocity

public Vector3 Velocity;

Flags

public EntityFlags Flags;

Vars

public byte[] Vars;

State

public byte[] State;

Keyframe from every sync behaviour (NetworkIdentity.WriteSyncSnapshot); empty when the prefab has none.

Methods

From

public static EntitySpawnMsg From(NetworkIdentity id, NetworkWriter scratch);

Write

public void Write(NetworkWriter w, MsgId id);

WriteBody

public void WriteBody(NetworkWriter w);

Read

public static EntitySpawnMsg Read(NetworkReader r);

On this page