Skip to main content

Product Event Timed

note

This information is only relevant to sellers with access to VRChat's Creator Economy SDK.
If you are interested in setting up a store in VRChat, please apply as a seller.

A ProductEvent is an event that only can be sent by a player who owns a product. Use this to enable GameObjects for a set amount of time when the product event is executed.

This can be customized in a variety of ways! For example, create a paid product that allows those players to set off fireworks for a certain amount of time.

You can read more about Udon events here and here.

How to Import

  1. Download the Unity package directly by clicking here.
  2. Make sure your project is using the World SDK 3.5.0or newer.
  3. Import the Unity package into your project.
Prefabs Included
  • SendProductEventPrefab: A prefab that sends the product event when the button is pressed and enables the GameObject for the set amount of time. Though only a player who owns the product can set off the event, OnProductEvent will be executed by all users. Meaning, only people who pay for the product can activate the event, but anyone can see or interact once the event is activated.
caution

If viewing the example scene, you'll also need the Open Group Page prefab. Otherwise, your project will be missing what it needs for a complete scene.

How to Use

For this (and most!) prefabs, you'll first need an UdonProduct to check for and a way for players to subscribe to this product.

Once you've created a purchasable product:

  1. Drag the ProductEventTimedSetActivePrefab into your scene.

EventPrefabtoScene

  1. In the inspector, locate the Udon Product variable. Click on the circle button and replace the example file with your own product. This product must be owned by the player trying to send the event.

EventProductAdd

  1. Next, locate Enable On Product Event GameObject. This is what will be enabled when the player with the correct UdonProduct clicks the button. You can replace this with whatever GameObject you'd like.

EventObjAdd

  1. Use Enabled Time to how long you want this GameObject to be enabled. This can range from .5-10 seconds.

  2. Run Build & Test!

Inspector Parameters

  • UdonProduct - The Udon product that will be used when sending the event. This product must be owned by the player sending the event.
  • Enable Product Event GameObject - The GameObject that will be enabled when the event is executed.
  • Enabled Time - How long the GameObject will be enabled for in seconds.