LinkedObjectSystem.md 2.6 KB

Linked Object System

Drives Animator bools and two audio objects from interactions and triggers: doors, buttons, pressure plates, lights. It replaces the Interact Script, Logic Script, Pickup Detector and Player Trigger.

Requires:

  • Collider (set to Is Trigger for the trigger types; any collider for interactions)
  • A GameObject of its own, or one whose other Udon scripts use Manual sync (or none). It uses Manual sync itself, which can't share a GameObject with VRC Object Sync or Continuous scripts.

Debug Mode - Type: Boolean

  • Logs every change to the console.

Delayed Interact Time - Type: Float

  • How long a Temporary interaction stays on, in seconds.

Exclude Layers - Type: LayerMask

  • Pickups on these layers don't count for the Object trigger.

Trigger Type - Type: Enum

  • Who keeps the output on while inside the trigger:
    • None: the trigger isn't used.
    • Player: any player.
    • Object: any pickup (a GameObject with VRC Pickup).
    • Both Player And Object: either.

Interaction Type - Type: Enum

  • What interacting with the object does:
    • None: it can't be interacted with.
    • Permanent: turns the output on for good.
    • Temporary: turns it on for Delayed Interact Time seconds; it can't be used again until then.
    • Toggle: turns it on and off.

Output Animators / Output Parameter Names - Type: Arrays

  • Each Animator gets its matching bool parameter set to the output. Empty entries are skipped.

Audio Object True / Audio Object False - Type: GameObject

  • Audio Object True is active while the output is on, Audio Object False while it's off. Either can be left empty.

Script Behavior:

  • The output is on while the interaction is on, or anyone or anything counted is inside the trigger.
  • Interactions are synced: everyone sees them, including players who join later.
  • Triggers aren't synced, because every player sees the same players and synced pickups enter. A player is only counted once, players who leave the instance stop counting, and pickups that are disabled or destroyed inside stop counting within a second.

Upgrading from 1.0.x:

  • Interactions used to show only for the player who interacted; now they're synced.
  • Interactions and triggers used to share one counter, so a trigger could end a Temporary interaction early or stop a Toggle; now they're separate.
  • Audio objects used to switch only when both were assigned; now each works on its own.
  • The behaviour switches to Manual sync. If it shares a GameObject with VRC Object Sync or a Continuous script, move it to its own GameObject.