Skip to main content

Product Owners Only Area

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.

Product Owners Only Area is a prefab that sets up an area that is only accessible to owners of a target product. Use this to create exclusive areas, events, and experiences in your world.

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
  • ProductOwnersOnlyAreaExamplePrefab: A prefab that contains a full example of how to use the ProductOwnersOnlyArea script.
caution

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

How to Use

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

Once you've created a purchasable product:

  1. Open the ProductOwnersOnlyAreaExampleScene from your Project window. The scene contains a building asset to help you test and understand how the prefab works.

PrefabScene

  1. In the Hierarchy, click on the ProductOwnersOnlyAreaExamplePrefab.

HierarchyClick

  1. In the Inspector, add which Udon Product you would like to check for when a player enters or is inside of a certain area.

AddProduct

  1. In the Hierarchy, select OpenListingSimplePrefab. Paste your listing ID here. This will show a link to purchase the product where necessary.
    • To get your listing ID, go to vrchat.com/home, then Marketplace -> Storefront -> My Listings.

AddListingID

  1. In the Hierarchy, click on the ProductOwnersOnlyAreaExamplePrefab again. You'll see a few different settings:

    • Trespassing Message is what appears if a player enters/is inside a product owner-only area and does not own the correct Udon Product.

    • Trespassing Teleport Location is where the player is sent if they try and enter or have ended up in a location they do not have access to. You can move this in your scene to wherever you like, just make sure it's outside of the owner-only area.

    • Area Colliders are what keep non-owners out of your exclusive area. In this prefab, it is a box collider inside of our example asset. You should adjust this in your scenes to best fit your needs.

TrespassingText

  1. If you would like to keep non-owners inside of a specific area instead, enable Keep People In Area. If enabled, make sure your spawn and Trespassing Teleport Location are within the collider instead of outside the collider.
tip

Enable this if you are creating a large, exclusive area, and want to keep all non-owners together. Think lining up to buy tickets before getting into an amusement park. We recommend you keep it disabled if you're only sectioning off a small part of your world, like an exclusive room.

  1. In the Hierarchy, click on the drop down arrow next to ProductOwnersOnlyAreaExamplePrefab. Click on ProductOwnersOnlyAreaBlockerToggle.

  2. In the Inspector, select the same Udon Product you chose earlier. Now, when a player owns this product, this door will be disabled.

    • You can read more about disabling and enabling blockers like doors and walls on the Udon Product Toggle prefab page.
  3. Run Build & Test!

Inspector Parameters

  • Udon Product - The Udon Product that determines ownership.
  • Trespassing Message - The GameObject that will be activated and shown when the player is trespassing to show them the trespassing message.
  • Trespassing Teleport Location - The location the player will be teleported to when they have trespassed.
  • Area Colliders - The colliders that define the area only owners/non-owners can access, depending on the Keep People In Area Toggle. These will be disabled at runtime to save performance.
  • Keep People In Area - Toggle this on to force players to stay in area instead of keeping them outside the area. Make sure your spawn and Teleport Location are inside the area if you use this.