Introduction to Items

Items in Unturned encompass anything that can be carried in a player’s in-game inventory. All items will share certain properties, but each item type may have its own unique properties as well. Please refer to Asset Definitions and Asset Bundles for the full documentation regarding assets and asset bundles.

Unity Asset Bundle Contents

../../_images/UnityExampleItem.png

An example of an item being set up in the Unity editor.

To get started, create a new folder for your custom item. The name of this folder will be relevant when further configuring your item after it has been exported from Unity.

Item (Prefab)

Inside this folder, create a new Prefab named “Item”. This should be tagged as 4: Item, and layered as 13: Item. Open the “Item” Prefab.

Items can have multiple colliders including different types, but just attaching a Box Collider component to the root GameObject will usually suffice. It is recommended to use a minimum dimension of (0.2, 0.2, 0.2), because the large colliders are less likely to fall through a thin surface in a single physics tick.

If your item only has one LOD, you can attach Mesh Filter and Mesh Renderer components directly to the root GameObject. Configure these components as desired.

It is recommended to have multiple LODs for your item, so that less needs to be rendered when the item is far away. If your item should have multiple LODs, attach a LOD Group component to the root GameObject. Create a child GameObject for each LOD, named “Model_#” (e.g., “Model_0”, “Model_1”). Attach the Mesh Filter and Mesh Renderer components to each one. Configure these components as desired.

Add a new child GameObject named “Icon” to the root GameObject. This will be used to draw an icon with an orthographic camera. By default, the game will automatically calculate the position and size of the camera – so the only thing that needs to be configured is its orientation. To test the orientation of your icon, temporarily attach a Camera component with its Projection property set to “Orthographic”. When satisified, delete the Camera component.

Animations (Prefab)

For equippable items, a Prefab named “Animations” is required. The Prefab and the animations included can either be created from scratch, or they can be duplicated from the provided Unity packages.

If you have installed the ExampleAssets.unitypackage we provide, you can find the vanilla animations for most item types in the game. Prefabs can be found along the CoreMasterBundle/Items path, while the raw animation files can be found along Game/Sources/Animations.

To create the Prefab from scratch instead, add a new Prefab named “Animations” in your custom item’s folder. Add an Animation component to the root GameObject of the “Animations” Prefab.

Every equippable item should have an animation named “Equip”. If your weapon should be inspectable, it should also have an “Inspect” animation.

Equip (Audio Clip)

To have a sound play when the item is equipped, include an Audio Clip named “Equip” in your custom item’s folder.

Game Data File

The GUID, Type, and ID properties are required by all item assets. Most item assets will usually want (or need) to include the Rarity, Useable, Slot, Size_X, and Size_Y properties as well, with only a few excepions.

Properties

Property Name

Type

Default Value

Allow_Manual_Drop

bool

true

Amount

uint8

1

Backward

bool

false

Bypass_Hash_Verification

bool

false

Bypass_ID_Limit

flag

Can_Player_Equip

bool

See description

Can_Use_Underwater

bool

See description

Count_Max

uint8

1

Count_Min

uint8

1

Destroy_Item_Colliders

bool

true

Equipable_Movement_Speed_Multiplier

float32

1

EquipablePrefab

Master Bundle Pointer

EquipAudioClip

Master Bundle Pointer

Equip

GUID

GUID

ID

uint16

0

Ignore_TexRW

flag

InspectAudioDef

Master Bundle Pointer

Instantiated_Item_Name_Override

string

See description

InventoryAudio

Master Bundle Pointer

See description

Left_Handed_Characters_Mirror_Equipable

bool

true

Override_Show_Quality

bool

false

Pro

flag

Procedurally_Animate_Inertia

bool

true

Quality_Max

uint8

90

Quality_Min

uint8

10

Rarity

EItemRarity

Common

Shared_Skin_Lookup_ID

uint16

See description

Should_Delete_At_Zero_Quality

bool

false

Should_Drop_On_Death

bool

true

Size_X

uint8

1

Size_Y

uint8

1

Size_Z

float32

-1

Size2_Z

float32

-1

Slot

ESlotType

None

Type

EItemType

Use_Auto_Icon_Measurements

bool

true

Use_Auto_Stat_Descriptions

bool

true

Useable

EUseableType

None

EUseableType Enumeration

Named Value

Description

None

Does not correspond to any useable type.

Clothing

Corresponds to the “Clothing” useable type.

Gun

Corresponds to the “Gun” useable type.

Consumeable

Corresponds to the “Consumeable” useable type.

Melee

Corresponds to the “Melee” useable type.

Fuel

Corresponds to the “Fuel” useable type.

Carjack

Corresponds to the “Carjack” useable type.

Barricade

Corresponds to the “Barricade” useable type.

Structure

Corresponds to the “Structure” useable type.

Throwable

Corresponds to the “Throwable” useable type.

Grower

Corresponds to the “Grower” useable type.

Optic

Corresponds to the “Optic” useable type.

Refill

Corresponds to the “Refill” useable type.

Fisher

Corresponds to the “Fisher” useable type.

Cloud

Corresponds to the “Cloud” useable type.

Arrest_Start

Corresponds to the “Arrest_Start” useable type.

Arrest_End

Corresponds to the “Arrest_End” useable type.

Detonator

Corresponds to the “Detonator” useable type.

Filter

Corresponds to the “Filter” useable type.

Carlockpick

Corresponds to the “Carlockpick” useable type.

Property Descriptions

Allow_Manual_Drop bool true

Item can be manually dropped by the player.


Amount uint8 1

Maximum capacity for container-like items, such as ammunition boxes. Typically used with Count_Min and Count_Max.


Backward bool false

Set the item to be held in the character’s non-dominant hand.


Bypass_Hash_Verification bool false

Disable hash verification check, and allow for mismatched files.


Bypass_ID_Limit flag

Allows for using an ID value within the range reserved for official content.


Can_Player_Equip bool

Item can be equipped by the player. If the Useable property has been set, then this defaults to true. Otherwise, this defaults to false.


Can_Use_Underwater bool

Item can be used while underwater. If the Slot property has not been set to Primary, then this defaults to true. Otherwise, this defaults to false.


Count_Min uint8 1

Minimum amount to generate, for container-like items. Typically used with Count_Max and Amount.


Count_Max uint8 1

Maximum amount to generate, for container-like items. Typically used with Count_Min and Amount.


Destroy_Item_Colliders bool true

If false, colliders are not destroyed when the “Item” Prefab is attached to the character. For example equipped vanilla guns do not have any colliders, but some mods (e.g., riot shields) may have relied on child colliders not being destroyed.


Equipable_Movement_Speed_Multiplier float32 1

Multiplies character movement speed while equipped in the player’s hands. If a gun is equipped, then any gun attachment multipliers are combined as well.


EquipablePrefab Master Bundle Pointer

Overrides the model spawned when this item is equipped. For example, the “Equipable” Prefab could use an animated skinned mesh component while the regular “Item” Prefab only needs a static mesh component.


EquipAudioClip Master Bundle Pointer Equip

AudioClip to play when equipping.


GUID GUID

Refer to GUID documentation. Item assets are required to have this property.

Tip

If the GUID property has been omitted from the asset file, then the game will automatically attempt to assign a random (and unique) GUID during a successful load.


ID uint16 0

Must be a unique identifier. Item assets are required to have this property.


Ignore_TexRW flag

Read/writeable texture errors regarding this asset should be hidden from the error logs.


InspectAudioDef Master Bundle Pointer

AudioClip or OneShotAudioDefinition to play when item is inspected.


Instantiated_Item_Name_Override string

Name to use when instantiating “Item” Prefab. By default, the value of ID is used. Since Unity’s built-in Animation component references GameObjects by name, this property can help share animations between items.


InventoryAudio Master Bundle Pointer

AudioClip or OneShotAudioDefinition to play when item is picked up, moved within the inventory, and dropped. Default value is dependent on the child asset.


Left_Handed_Characters_Mirror_Equipable bool true

If false, the equipped item model is mirrored to counteract the mirrored character.


Override_Show_Quality bool false

Override to forcefully show item quality.


Pro flag

This is a Steam Economy item.


Procedurally_Animate_Inertia bool true

Whether viewmodel should accumulate angular velocity from animations. Useful for low-quality older animations, but should probably be disabled for high-quality newer animations.


Quality_Max uint8 90

Maximum quality to generate. Typically used with Quality_Min.


Quality_Min uint8 10

Minimum quality to generate. Typically used with Quality_Max.


Rarity EItemRarity Common

Rarity of the item, as text shown in menus and colors used for highlights.


Shared_Skin_Lookup_ID uint16

Share skins with another item. Defaults to item’s ID.


Should_Delete_At_Zero_Quality bool false

Item should be deleted when at 0% quality.


Should_Drop_On_Death bool true

Item should be dropped on death.


Size_X uint8 1

In slots, the total width of the inventory space (i.e., the number of columns).


Size_Y uint8 1

In slots, the total height of the inventory space (i.e., the number of rows).


Size_Z float32 -1

Manually specify orthogonal camera size for item icons. This directly corresponds to the value of a Camera component’s Size property in Unity.


Size2_Z float32 -1

Orthogonal camera size for economy icons.


Slot ESlotType None

Which equipped item slot an item is valid to be equippable in. This is only relevant if your property has configured the Useable property.

  • None restricts the useable item to hotkeys.

  • Primary restricts the useable item to the primary slot.

  • Secondary restricts the useable item to the primary or secondary slots.

  • Tertiary is not implemented by this asset.

  • Any has no restrictions on slots or hotkeying.


Type EItemType

Designates the item’s class. Item assets are required to have this property.


Use_Auto_Icon_Measurements bool true

Automatically calculate axis-aligned item icon camera size from bounds.


Use_Auto_Stat_Descriptions bool true

If true, properties like damage, storage, health, etc. are appended to the description.


Useable EUseableType Enumeration None

Class for how to treat equippable items. This is often used with the Slot property, which determines which item slots an item is equippable in.

Blueprints and Actions

In addition to the properties already described, item assets can utilize properties for crafting blueprints and context menu actions.

Localization

Name string: Item name in user interfaces.

Description Rich Text: Item description in user interfaces.