Skip to main content

Product Event Timed

tip

Submit an application if you want to join the Creator Economy!

The page below is only relevant to sellers with access to VRChat's Creator Economy.

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. Open the Example Central Window from the window from the Unity Editor Menu under "VRChat SDK > 🏠 Example Central"
  2. If you haven't enabled Creator Economy examples yet:
    1. Press the ⚙️ gear icon in the Example Central window to open the Example Central settings.
    2. Enable "Show Creator Economy Examples".
  3. Select this prefab in Example Central.
  4. Press the "Import" button to import the example assets 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 buy 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.