-
Notifications
You must be signed in to change notification settings - Fork 2
Coming From SDK2
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.
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
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.
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. The VRC_ObjectPool component was provided as a replacement for spawning objects. 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.
In SDK2, a VRC_Trigger could call extra methods on other VRChat components through the SendRPC action. CyanTriggers and Udon do not need a special action to call these extra methods, but instead can call them directly. As an example, SendRPC "UseStation" would be replaced with the "VRCStation.UseStation" action.
In SDK2, the SetComponentActive action would find all components on an object of the specified type and enable or disable them. In CyanTriggers, the proper way to enable or disable a component is to use the "set Enabled" action for that component. As an example, if you wanted to disable a BoxCollider, you would use the BoxCollider.set Enabled action.
In SDK2, every operation that worked with bools had the ability to toggle the value. This does not exist in CyanTriggers. Some Custom Actions have been created to help with this, like GameObject.ToggleActive, but not everything has this option. The proper way to toggle an object requires 4 actions. See the mirror toggle guide on details for how to toggle an object. This can be extended for components by using the "get Enabled" and "set Enabled" actions for that component.
- 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.