Item Definitions

Modified on Tue, 14 Dec 2021 at 05:23 PM

An Item Definition is an asset that represents an object that can be carried in the inventory:



Items can be of 4 types:

  • Voxel: an item can represent a voxel. For example, in build mode all voxels shown in the inventory are items created by the system. Pressing right-click on the scene will consume one unit of the voxel from your inventory and place a new voxel on the target position. Since voxels are automatically added as items in build mode you don't need to duplicate voxels as items. However if you manually want to have some specific voxels as items you can create them using this option.
  • Torch: represents a light source. The torch item uses a special behaviour predefined in Voxel Play so it can be attached to any other solid voxel. Torches are linked to their chunks and saved/loaded with the same chunk.
  • Model: represents a model definition. You can create them in the constructor.
  • General: general items represent any other object like weapons, cloth, shield, potions, etc.


To create a new Item Definition select top menu Assets / Create / Voxel Play / Item Definition. This option will create a new Item Definition asset inside the Items folder of your world. The name for this item is the name of the asset file.


Item Definition's fields


  • Title: an alternate text to the name, used in the default user interface when this object is selected.
  • Icon: the texture used to represent the item in the inventory.
  • Icon Prefab: you can use this field to assign any prefab that you want your character to show when this item is selected. Important: Voxel Play character controllers do not use this field. It's up to your character controller or your own game logic to show/hide this selected item on your character. However you can store the icon prefab on this field so both the item in the inventory and the actual gameobject that your character should show in hand are related.
  • Use Sound: an optional sound clip played when this item is used (ie. attacking while this item is selected).
  • Can Be Picked: if the object can be picked from the scene.
    • Pick Mode: how the object can be picked. Currently it accepts two options: on player approach, or on click.
    • Pickup Sound: an optiona sound clip played when this item is collected.
  • Prefab / Model: the prefab to be instantiated when this item is created.
  • Properties: an array of user defined attributes in the form of Name/Value.


The following property names are recognized by the default FPS controller:

  • hitDamage: the damage amount caused when this item is selected.
  • hitDelay: the delay between consecutive attacks.
  • hitRange: the attack range.
  • hitDamageRadius: the radius of the damage.



Item persistence


Items are linked to the chunk at their positions. When saving the game, the items are also saved along the chunk data.







Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article