Skip to content

CyanTrigger Interface

CyanLaser edited this page Apr 21, 2021 · 2 revisions

CyanTrigger Component

CyanTrigger

CyanTriggers consist of two components: The CyanTrigger Component and an UdonBehaviour Component. Since this is SDK3, the UdonBehaviour is necessary for everything to work in game. The CyanTrigger component is just a fancy UI for creating Udon programs. When you add a CyanTrigger to a GameObject, an UdonBehaviour is also added and linked to that CyanTrigger. You will do all work in the CyanTrigger and not in the UdonBehaviour.

Other Settings

OtherSettings

The Other Settings section is a contextual section. This will only appear when needed based on the components on the object or the events used in the CyanTrigger. Currently there are only two options: Animator Move options and Interact options. Animator Move will only display when you have an Animator component on the same object as the CyanTrigger. This option specifically will auto apply root motion for the animator since adding an UdonBehaviour to an object requires root motion to be handled directly. The interact options will only display when the CyanTrigger has the Interact event. These options allow you to change what text is displayed when interacting with an object and how close the user needs to be for the interact option to activate.

Variables

Variables

The next section is the variables section. This is something not included in SDK2 VRC_Triggers. This section is entirely optional, but is helpful in creating more complex systems. A variable is a way to save data on the object that events and actions can access. Variables can also be synced so that every player in the instance has the same data. If you are new to using variables, there will be guides available on release on how and when to use them. There are four buttons at the bottom of the variables list.

  • Star - Add a new variable, picking from the list of favorite variable options. This list is custom and can be set by the user in the CyanTrigger settings.
  • Plus - Add a new variable, picking from the list of all possible variable options.
  • Two Page - Duplicate the selected variables.
  • Minus - Delete the selected variables. See Variables section for more information on Variables

Events

Event Header

EventHeader

The events section has been expanded compared to SDK2 VRC_Triggers. The header section has 7 buttons now. The first two buttons show the selected event. Since users can define custom events, the second button represents variants of the event with the same name. In the example, the base event is Interact. The variant is VRC_Direct, which is VRChat’s default and not a custom event. The arrow buttons on the right will move the event up or down the list. The X will delete individual events. The last two buttons are an extension of SDK2's broadcast setting. The first button represents "who can activate" this event. The second button represents "who will execute" this event.

ActivationTypes

By default, every event can be activated by anyone who tries. There are 4 other options though. If you are dealing with ownership, you can set the event to only activate when the current owner of the object tries to use the event and ignore all other players who aren't the owner. You can do the same for the master of the world instance. The last two options are user allow list or user deny lists. For User Allow List, anyone who has a user display name on the list will be allowed to activate this event. For User Deny List, anyone who has a user display name on the list will be denied from activating this event.

AllowList

Example of User Allow List which allows "CyanLaser", "LocalPlayer1", and any user who has the same display name as the variable Some_other_username.

Broadcasts

There are three different options for who can execute the event.

  • Local means only the local user who activated the event will execute the event.
  • Send to Owner will only execute on the player who owns this object. The owner does not need to be the one who activates this event, but they will be the one who executes it.
  • Send to All means that everyone in the instance will execute the event. At this time, the buffering system from SDK2 is not supported. If you would like to sync something for late joiners, the intended method will be to use variables.

Event Inputs

By default, every event has the delay input. This delay is the same as in SDK2 in that the actions will only execute after the delay in seconds. With custom events, users can add extra input options. Some events will also provide variables that you can use in your actions.

CustomEventEditor

Here is an example of a user defined custom event which is a variant on OnTriggerEnter. This custom event defines an input, a list of GameObjects, and provides a variable that you can use in the actions, onTriggerEnterOther which is of type Collider.

Actions

Adding Actions

ActionList

The actions list has been expanded compared to SDK2. There are now 6 buttons at the bottom for modifying the list.

  • "SDK2" - Add a new Action, selecting from a list of options similar to what SDK2 provided. This is intended to help those who don't want to fully explore everything in Udon.
  • Star - Add a new Action, picking from the list of favorite actions. This list is custom and can be set by the user in the CyanTrigger settings.
  • Plus - Add a new Action, picking from the list of all possible actions provided by Udon and Custom Actions created by users.
  • Shapes - Add a new local variable action.
  • Two Page - Duplicate the selected actions.
  • Minus - Delete the selected actions.

Action Editor

ActionEditor

When editing an action, the input options will display with the action. This means you can expand and edit multiple at once if you want. The Plus and Minus to the right of the action list will expand or contract the action editor for that action. In the example, you can see one action expanded to show the options and inputs. The variant selector is the first option and then the inputs into the action are listed. With CyanTriggers, most action inputs can be either a constant value or a variable. The drop down box next to the input lets you select between a constant or variable. SDK2 VRC_Trigger only allowed for constant inputs.

Action List

The action list has been upgraded compared to SDK2. Each action display now shows the parameters directly so you can see what things the action is modifying or using. Seeing the parameters can clutter the view, so there is an option to disable it in the settings. Another upgraded feature is that you can select multiple actions and move multiple at once.

DragReorder

The action list itself is now more than just a list of actions. It now supports nesting. Nesting can be used for organizing different sections of your action list, but it is also needed for more advanced logic such as If checks and while loops.

NestedActions