Vending Machines
The page outlines a detailed guide on setting up a vending machine in a WB project.
Last updated
The page outlines a detailed guide on setting up a vending machine in a WB project.
Last updated
In order to sell items from vending machines, you will need a currency to transact in. If you do not already have a currency created for your project, see Account Balances.
You will need create purchasable items to add to your vending machine. Follow the Public Purchasable Guide to create purchasable items/
Before you can create and place vending machine actors in your project, you will need to tell the game what purchasable items exist. In order to do this, we first need to create a data table that uses the FBasePurchaseableTableRow
structure. This links a UM2_PurchaseablePrimaryAsset
asset with a currency and price. Below shows an example data table:
Once your data table is setup, you will need to add your data table to the world settings shown below:
When run, your game should now know what items can be shown in vending machines.
We recommend creating a new custom vending machine actor asset for you project. This should be done by inheriting from BP_VendingMachine
. This base class utilizes the M2 interaction system and the M2 interaction system menu. If this is not right for your project, get in touch with our gameplay support team to work out what solution is best for you.
You can use the PurchasableIds
property on your newly created vending machine asset to configure exactly what purchasable items are available. Simply add the corresponding row name from the vending machine purchasable data table you created for purchasable items you wish to be available in your vending machine.
Add the vending machine to your world and you should be good to go!