Skip to content

Coming From SDK2

CyanLaser edited this page Apr 21, 2021 · 5 revisions

The CyanTrigger interface was designed based on the SDK2 VRC_Trigger. Although similar, CyanTriggers have more features, which could make it harder to navigate. In SDK2, all action and event lists were just one large list to pick from. In CyanTriggers, these have all been organized into different sub categories. There is only one searchable list for events, but multiple for actions. CyanTriggers contains all of Udon, but this is overwhelming to start. To help people adjust from SDK2, there is a list of actions that contain most of the SDK2 actions.

Differences

Disabled Triggers

In SDK2, disabled VRC_Triggers would ignore all actions. This is not the case with CyanTriggers. First, CyanTriggers cannot directly be disabled. If you want to disable a CyanTrigger, you will need to disable the UdonBehaviour instead. If you would like to ignore Events while the CyanTrigger or the object is disabled, you will need to add the “ReturnIfDisabled” Action to the top of your events. See Guides for more details

Buffered Actions

In SDK2, VRC_Triggers offered a system called Buffering which allowed actions to be replayed for late joiners. While confusing, it was entirely possible to sync VRChat instances for everyone joining. CyanTriggers at this time does not support Buffering. Instead, variables should be used to handle late joiners. See the guide on Variables for more details.

Spawning Objects

While Udon does support spawning objects, these objects will not be networked. SDK2 made spawning easy, but in Udon, VRChat prefers people use Object pools instead. An object pool mechanism will be provided in VRChat’s networking update, but is not available in the live sdk. There is also a known bug with CyanTriggers in that spawning a prefab from the assets folder that contains a CyanTrigger will not work once spawned.

Missing from CyanTriggers

  • OnTimers Not currently implemented, but planned. For now, you will need to use delays, either in the CyanTrigger interface, or using UdonBehaviour.SendCustomEventDelayed.
  • OnKeyDown/Up There is no direct event for OnKeyDown or OnKeyUp for keyboard input. VRChat has released input events for general items like Jump or Grab actions. If you want specific keyboard input, at this time, you will need to use an Update event and check when Input.GetKeyDown inside an If action. See Guides for an example how to create this.
  • Random Action An easy method for randomized lists is in design, but not currently implemented. Using Udon nodes, it is possible to recreate this, just it isn’t simple yet. See Guides for an example how to create this.
Clone this wiki locally