Skip to content

CVR Variable Buffer

Stores a single float variable on a GameObject. Other components can interact with the buffer via method calls or through CVR Interactable triggers and actions. Interactables that reference the buffer are notified on write (subject to a 100ms throttle).

float. Initial value assigned to value on Start.

float. Current buffer value. Read at runtime by interactables and parameter streams.

  • SetValue(float valueToSet) — write the buffer and notify every linked interactable via OnVariableBufferChange. Notifications are rate-limited: after a notify pass is sent, further writes within the 100ms ResetSendUpdate tick reuse the suppressed state.
  • SuppressNextUpdate() — request that the next SetValue call skip the notify pass.
  • AddInteracteable(CVRInteractable interactable) — registers an interactable as a listener. Normally called by CVRInteractable during Start when any of its action or operation varBufferVal slots reference this buffer.

A scheduled job (BetterScheduleSystem) runs every 100ms to reset the internal _sendUpdate flag. This means:

  • Multiple SetValue calls within the same 100ms window only send one notification.
  • Use SuppressNextUpdate() just before a SetValue to avoid redundant fan-out.

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