🚧Token Gating

Documentation for ODK In World Gating using objects and NFTs

An example of a Token Gate

In-world gating uses the base class BPM_GatedAreaBase.

This can be done by opening Editor Preferences > Sign-In Settings and adding your credentials.

This feature intends to allows devs to limit access to gameplay. Players are limited on a condition. This condition usually concerns token ownership, however, the system allows for completely generic gating. BPM_ODK_GatedArea_Plane is a fully working example that you can use to start gating access to areas of your map. If you plan to create you own type of gated area, we recommend looking at this asset to understand the workings of the system. It has a property GateCondition that can be used to configure who can navigate into an area.

Gating Conditions

Gating conditions can be added to the gated area actor by configuring the GateCondition property in the details panel of the BPM_ODK_GatedAreaBase. In the following example, the gated area is gated on whether a player has any token on the ethereum block chain.

There are many types of gate condition that are defined in the ODK. The BP_ODK_GateCondition_AND and BP_ODK_GateCondition_OR are key conditions that allow you to combine conditions together for more complex gating. The following shows a gate condition that requires ownership of both a bored ape and a mutant ape (defined by giving a contract address).

If you can not find the condition you need defined within the ODK, you can create your own condition by deriving a new object from BP_ODK_GateCondition and overriding the IsConditionSatisfied function in your new asset.

An example of overrideing IsConditionSatisfied to check whether a player has any token from an array of configurable NFT Chins.

Last updated