The SDK of this version is still being tested, and these pages are being updated with it: names, menus and procedures may still change before the release. If you build content for a platform already in production, follow the documentation of that version — pick it from the version menu at the top right.
Inventory and items
The Inventory Placeholder sets up everything the player carries in your environment: the tools in the hand slot, the items in the inventory and the equipment slots where wearables go. You add one to the scene, choose what it shows and how many slots it starts with, and you can change both while the experience runs.
The things the player carries are described in their own pages:
- Pickables - the items, their uses, how they are dragged, and the wearables.
- Tools - the items held in the hand and used with the use key.
- Item targets - the objects an item or a tool is used on.
- Spawnable Object - how an item is held in the hand.
For what the player sees and does, see the end-user page Inventory & pickables.
The Inventory Placeholder
Add the Inventory Placeholder to an object of the scene (an empty one is enough). Use one per scene.
Inventory Mode
Inventory Mode chooses what the player gets. Only one is active at a time, because in VR one controller button opens it.
| Mode | What the player gets |
|---|---|
| Inventory (default) | The inventory: the items, the equipment slots and the hand slot that holds the tools. The tools' radial menu opens from the hand slot. |
| Tools | Only the tools: the hand slot, which opens the radial menu. |
| None | Nothing: no inventory and no tools menu. |
You can change the mode during the experience, from a script (InventoryMode) or with the Set Mode node (see Inventory Nodes). The application hides what was shown and shows the new one.
Tools section
| Field | What it does |
|---|---|
| Inventory Items | The tools the player has from the start, in the radial menu. See Tools. |
| Z Offset, Radius, Open Speed | Where the radial menu opens in front of the camera, the radius of its circle and the time it takes to open. |
| Action | An input of yours that opens and closes the radial menu. The application's own keys (see Tools) work as well. |
| Picked Tools Shared | Multiplayer: a tool a player picks up goes to the radial menu of every player, also of those who join later. Off: only to the one who picked it. A tool can decide for itself with its Pickup Sharing. |
| Display Empty Hand, Empty Hand Sprite, Empty Hand Name | Adds an empty hand entry to the radial menu, with the sprite and the name you give: choosing it puts the tool away. |
Y Offset is on the placeholder but the application does not use it: the radial menu is placed with Z Offset only.
Inventory section
| Field | What it does |
|---|---|
| Equipment Slots | The equipment slots, each with a Type, a Name and an Icon. See Equipment slots. |
| Wear Slots Count | Wear slots to start with, used only when no Equipment Slots are declared. |
| Inventory Slots Count | Item slots to start with. A slot is added when an item does not fit. |
| Show Item Count | Whether each slot shows how many copies of the item the player has. |
| Starting Items | The items every player has from the start. See Starting items. |
| Inventory Action, Inventory Z Offset, Inventory Y Offset, Inventory Open Speed | VR only: the input that opens and closes the inventory, where it opens in front of the camera and how long it takes. Without an Inventory Action, the B or Y button opens it. |
Multiplayer
| Field | What it does |
|---|---|
| Return Items To Origin On Leave | When a player leaves, the items they took from the scene for themselves go back into the room. Off (default): near where the player left, spread so they do not overlap. On: each one where it was at the start. Tools are not dropped. |
Equipment slots
An equipment slot says where a thing goes on the player. There are two types:
- Hand: the slot of the tools. It always shows the application's own hand icon, and appears when the player has tools.
- Custom: a slot with a name of your choice (Head, Gloves, Badge...), for wearables. A wearable goes to the slot whose name it gives in its Wear Slot (see Wearables).
Declare the slots in Equipment Slots:
| Field | What it does |
|---|---|
| Type | Hand or Custom. |
| Name | Custom: the name the wearables give in their Wear Slot. |
| Icon | Optional. Shown on the slot in place of its name, to say what it is for. |
Declared slots are shown from the start, empty ones included. A wearable whose slot you did not declare adds it, so nothing is refused. With an empty list, the wear slots are plain cells counted by Wear Slots Count.
A slot holds the wearables of its name, one worn at a time. One wearable: the slot's cell puts it on and takes it off. Several: the cell opens a radial menu to choose which one is worn, with a none entry to take it off when the item can be removed.
At most one tool is in the hand: the hand slot holds all the tools the player has, and the radial menu chooses which one is held.
Slots and quantities
The inventory never refuses an item for lack of room: the counts are where it starts.
- When an item does not fit, a slot is added. Inventory Slots Count follows, and the Slot Counts Changed event is raised.
- The slots round up so that the grid has no holes: on the first page to whole columns once a second column starts (whole rows in VR), then to whole pages. The new slots are empty and usable.
- A page is the grid the player sees: on desktop and web up to 6 rows and 4 columns, with the equipment taking one of the columns; on mobile 4 cells in all, equipment and items together; in VR 5 columns by 3 rows for the items and 4 by 3 for the equipment. Past a page, arrows turn the pages.
- Copies of the same item stack in one slot. The slot shows the quantity of copies from 2 up; a single copy shows no number. It never shows uses.
- Each copy keeps its own uses (the pickable's Number Of Uses): a use spends the top copy's, and a copy taken out of the inventory takes its own with it. An item with unlimited uses (-1) shows no "∞".
- A use from the slot raises the item's On Item Used, and its On Item Expired when the top copy's last use is spent: see Events.
Starting items
Starting Items lists the items each player has from the start. They are routed as if the player had picked them up:
- a wearable goes to its wear slot, and is worn;
- a tool goes to the hand slot (the tools' radial menu); a tool is never shared with the other players this way;
- anything else goes to the inventory.
List prefabs, or objects that are not in the scene: an object listed from the scene stays in the scene too, and the player could pick up a second copy.
Changing the inventory during the experience
From a script or from Visual Scripting, on the same placeholder:
| Member | What it does | Node |
|---|---|---|
InventoryMode | The mode, readable and settable. | Set Mode |
InventoryModeChanged | Raised when the mode changes, with the previous and the new mode. | |
SetSlotCounts(wearSlots, inventorySlots) | Gives the inventory more slots. Counts only grow: a smaller value is ignored, because a slot may hold items. wearSlots counts only when no Equipment Slots are declared. | Set Slot Counts |
SlotCountsChanged | Raised when a count grows, also when the inventory grows on its own. | |
AddEquipmentSlot(type, name, icon) | Declares one more equipment slot, for example one a task unlocks. A slot already declared (same type and name) is not added twice. | Add Equipment Slot |
EquipmentSlotsChanged | Raised when a slot is added. |
InventoryModeChanged is a named delegate (InventoryModeChangedHandler): subscribe a method of your script to it.
using UnityEngine;
using Virtuademy.Environments.ScriptingApi.Placeholders;
public class UnlockGloves : MonoBehaviour
{
[SerializeField] private InventoryPlaceholder inventory;
// Hook this to the event that unlocks the slot, for example a task's On Completed.
public void Unlock()
{
inventory.AddEquipmentSlot(InventoryPlaceholder.EEquipmentSlotType.Custom, "Gloves");
}
}
In a multiplayer session
The inventory belongs to each player: what one player carries or wears is not shown in the others' inventory.
- Picking up: when a player picks up an item from the scene, it disappears for everyone. If two players try to take the same item at once, the room's master decides and only one gets it.
- Tools: Picked Tools Shared and each tool's Pickup Sharing decide whose radial menu a picked tool goes to. The tool a player holds is shown in their hand to the other players (see Tools).
- Dropping: an item dropped into the world keeps its remaining uses, stays in the room if its dropper leaves, and any player can pick it up.
- Leaving: see Return Items To Origin On Leave above.
The earlier placeholders
Before 2026.7 the tools and the inventory had a placeholder each. Both still work, and an environment that has them behaves as it did:
| Placeholder | What it does |
|---|---|
| Tool Inventory Placeholder | The tools' radial menu: Inventory Items, Z Offset, Radius, Open Speed, Action and the empty hand fields, as in the Tools section above, plus Picked Tools Shared. A tool the player picks up goes to the menu, and the player chooses it there. |
| Inventory Slot Placeholder | The slots: Wear Slots Count, Inventory Slots Count, Show Item Count and Starting Items. The counts are limits on desktop, web and mobile: an item that does not fit is refused, with a message. In VR the inventory opens with the B or Y button, with no limit. |
They have no modes, no equipment slots and no runtime changes, and the nodes of Inventory Nodes need the Inventory Placeholder. Use the Inventory Placeholder for a new environment. To move an existing one, replace the component: its fields have the same names.
Known limits
- VR layout. The inventory in VR (its position and size in front of the player, the row of slot icons and the radial menu above it) is still being tuned and may change before the release.
- Mobile. A phone shows at most four cells at a time, equipment and items together (two columns of two cells, or four in one row on a wide screen), and pages the rest. How an inventory with many columns fits a phone held upright (portrait) is a to-do: it has not been designed or tested.
- Y Offset. The Y Offset of the Tools section is on the placeholder and ignored: the radial menu is placed with Z Offset only. (The VR Inventory Y Offset is used.)
- Shared tools and late joiners. A tool picked by one player reaches the others by looking up its object in their scene. When that object is already gone on their side, or for a player who joins after it was picked up, the tool is not found and is not added to their menu (the application logs a warning).
- Wearables on the avatar. A wearable only keeps its worn state and raises On Worn and On Removed: the application does not show it on the avatar.