Vket Interact Trigger / Vket OnBooth Trigger

Overview

Like the Trigger in the VRCSDK2, these Udon Behaviors will run an action upon Interact or entrance to the space. You may refer to VketTriggerSample sample scene in the Assets/VketAssets/VketPrefabs/VketTriggerSample for detailed use.

You may choose to run several of the below actions.

  • SetGameObjectActive: Set the Active of an object to be True or False, or Toggle.
  • SetAnimatorTrigger: Set the Trigger of Animator parameter.
  • SetAnimatorBool: Set the Bool Animator parameter to be True or False, or Toggle.
  • SetAnimatorInt: Set or make arithmetic operations on Int Animator parameter.
  • SetAnimatorFloat: Set or make arithmetic operations on Float Animator parameter.

You may choose local or Sync, though the status may not be synced with players joining the world later.

How to use (Interact)

Set the object and collider to which you want the Interact. Here we’ll explain with the example of using a Cube as a switch.

Create a Cube inside the Hierarchy and turn on the Is Trigger of the Box Collider.

trigger

Click Add Component button on the Inspector and add a UdonBehavior component.

trigger

Select Vket Interact Program Asset from the dropdown menu of the added UdonBehaviour and click “New Program”.

trigger

You will see the setting window of On Interact.

trigger

  • Broadcast
    You may choose local or synchronization (All Player),
  • Interaction
    • Interaction Text
      You may change the text that shows up when the player moves to Interact.
    • Proximity
      You can adjust the distance from which the player can Interact.
    • Text Placement
      Not used. Please leave it as none.
  • Action
    You can set the Actions to be performed (to be explained later).

Move SerializedUdonProgramAsset to the submission folder

The SerializedUdonProgramAsset generated is located on Assets/SerializedUdonPrograms.

Use a tool to move

Inside VketTols on the top bar is a tool called MoveSerializedUdonPrograms. By using this tool you can automatically move all SerializedUdonProgramAsset into the submission folder.

trigger

Manually move

You can also manually move the file to the submission folder.

trigger

Inside Udon Behaviour (Script), you may find a .asset file with a long name in Serialized Udon Program Asset under Program Source. By clicking this line, you can select generated SerializedUdonProgramAsset on the Asset window.

trigger

Drag and drop this file toAssets/[exhibitor ID]/[exhibitor ID]_UdonProgramSources folder. In this way, the file will be packaged together upon submission.

How to use (OnBooth)

Create an empty Game Object inside the Hierarchy.

Click on the Add Component button on the Inspector and add UdonBehavior component.

trigger

Select Vket OnBooth Program Asset from the dropdown menu of the added UdonBehaviour and click “New Program”.

trigger

You will see setting windows of OnBoothEnter and OnBoothExit. The Action in the OnBoothEnter will be performed upon player’s entry to the space, whereas the action in the OnBoothExit will be carried out when the player goes out of the space.

trigger

  • Broadcast
    You may choose local or synchronization (All Player),
  • Action
    You can set the Actions to be performed (to be explained later).

Move SerializedUdonProgramAsset to the submission folder

The SerializedUdonProgramAsset generated is located on Assets/SerializedUdonPrograms.

Use a tool to move

Inside VketTols on the top bar is a tool called MoveSerializedUdonPrograms. By using this tool you can automatically move all SerializedUdonProgramAsset into the submission folder.

trigger

Manually move

You can also manually move the file to the submission folder.

trigger

Inside Udon Behaviour (Script), you may find a .asset file with a long name in Serialized Udon Program Asset under Program Source. By clicking this line, you can select generated SerializedUdonProgramAsset on the Asset window.

trigger

Drag and drop this file toAssets/[exhibitor ID]/[exhibitor ID]_UdonProgramSources folder. In this way, the file will be packaged together upon submission.

Action setting

Click on “+” and select the actions you want to add.

trigger

  • SetGameObjectActive: Set the Active of an object to be True or False, or Toggle.
    • Operation: Select from True, False, or Toggle.
    • Receivers: Set the object to which it will be performed.
  • SetAnimatorTrigger: Set the Trigger of Animator parameter.
    • Parameter: Specify the animation parameter name.
    • Receivers: Set the object to which it will be performed.
  • SetAnimatorBool: Set the Bool Animator parameter to be True or False, or Toggle.
    • Operation: Select from True, False or Toggle.
    • Parameter: Specify the animation parameter name.
    • Receivers: Set the object to which it will be performed.
  • SetAnimatorInt: Set or make arithmetic operations on Int Animator parameter.
    • Operation: Select the operation to be performed like set or arithmetic operations.
    • Parameter: Specify the animation parameter name.
    • Int Value: Set the value of the operation.
    • Receivers: Set the object to which it will be performed.
  • SetAnimatorFloat: Set or make arithmetic operations on Float Animator parameter.
    • Operation: Select the operation to be performed like set or arithmetic operations.
    • Parameter: Specify the animation parameter name.
    • Float Value: Set the value of the operation.
    • Receivers: Set the object to which it will be performed.

Sample scene

You will find a scene like the below image by opening VketTriggerSample in Assets/VketAssets/VketPrefabs/VketTriggerSample.

trigger

The cube on the left side is set SetGameObjectActive(Toggle). When toggled, the sphere in the back will vanish and reappear.
The cube on the right side is set Animation Trigger. When toggles, the sphere in the back will start the animation of vertical movement.

Please utilize this scene as an example to make use of these resources.