Skip to content

CVR Builder Spawnable

Runtime helper for the builder mode, used to synchronize a preview asset’s position, rotation, and scale while it is being placed. Implements INewtonBuilderAsset. The component’s Reset() schedules its own destruction if a CVRSpawnable is present on the same GameObject, so you only use one or the other.

bool. When true the builder is allowed to auto-generate trigger colliders for this prop. Default true.

string. Hex colour (#RRGGBB form). Applied to the _PrimaryColor and _Color shader properties via a MaterialPropertyBlock. Default #E100FF.

string. Hex colour. Applied to the _SecondaryColor and _EmissionColor shader properties. Default #E100FF.

string. Asset id used by the sync helper. Set by Create(guid, bundleId).

string. Per-placement instance id. Generated from GUID plus a random suffix by Create().

  • Create(string guid, string bundleId) — initialise, send spawn packet via CVRSyncHelper.SpawnBuilderSpawnable.
  • SetColours(string primary, string secondary) — parse hex colours and push them to every renderer’s MaterialPropertyBlock. Throws if either hex string is invalid.
  • UpdateFromNetwork(CVRSyncHelper.BuilderSpawnableData data) — inbound network snapshot.
  • ForceUpdate() — flag that a position / rotation / scale send is needed.
  • Delete() — request removal through CVRSyncHelper.DeleteBuilderSpawnable.

On Start, all child colliders are passed through CVRTools.IgnoreMenuCollisions and the colour block is pushed to each renderer. A send job runs every 100ms and pushes outbound position / euler angles / local scale when needsUpdate is set. Inbound snapshots are interpolated against the network tick interval, with a one-second fallback for overruns.

CVR-GameFiles/ABI.CCK.Components/CVRBuilderSpawnable.cs