Gated Access
Last updated
Last updated
To create exclusivity and restrict access to experiences based on specific item ownership in YOM, you can follow these steps:
By default, the Gated Access component (YomGatedAccess) should already be connected to your Metaspace Player. If you don't see it as a component, you'll need to add it manually.
To add the component, click on the "Add Component" button in the blueprint editor and search for "Yom Gated Access." Add it to your Metaspace Player blueprint.
To implement the Gated Access functionality, search for "Yom Gated Access" in the Place Actors window and drag it into the level where you want to create the restricted zone.
Click on the Gated Access actor in the level.
Look for the "Item ID" property and insert the NFT address or master ID of the NFT item that is required for access. Note that you have separate IDs for devnet and mainnet.
Set up a collision object channel for the Gated Access to work properly.
Go to Project Settings and navigate to the Collision section.
Click on the "New Object Channel" button.
Name the channel as "GatedAccess" and set the default response to "Overlap."
Notes:
You can check if a player has access to the Gated Access zone by calling the blueprint function "Can Player Access."
Make sure the inventory is enabled for the player for this functionality to work.
The user's wallet needs to be fetched before they can go through the Gated Access.