There are two ways an item can be added to the character through the Item Manager:

  1. Create the item with the Item Manager and assign the item to the character. This is the most common method and it requires all possible items to be added to the character at edit time.
  2. Create the item with the Item Manager and don’t assign the item to a character, resulting in a prefab of the item. This method is extremely useful for RPGs where there are many items to configure.

This page will walk through the second method. This page is split up into two sections, one for first person items and the other for third person items. If you are using both perspectives then both sections need to be performed, with step 1 combined so only one item is created within the Item Manager.

First Person Perspective

  1. Open the Item Manager. Specify the following fields:
    • Name: The name of the item.
    • Item Type: The Item Type that provides a unique id for the item.
    • Slot ID: The slot that the item will occupy.
    • Animator Item ID: Optional, the Item ID used within the Animator.
    • First Person Base: Optional, the arm object that the item should be parented to. If this field is left blank (which is the most common) then the item will search for the parent based off of the FirstPersonBaseObject component ID.
    • First Person Visible Item: The object rendered within the game.
    • First Person Visible Item Animator Controller: Optional, the Animator Controller for the First Person Visible Item.
    • Action Type: The type of Item Action to add to the item.

    The following screenshot provides a sample setup:

  2. Build the item to a new prefab. Select that prefab within the project.
  3. Because we left the First Person Base field blank we need to specify which object the Visible Item will be parented to. We are going to specify a value of 0 for the First Person Base Base field of the First Person Perspective Item component because we want to use the first person arms that are already created under the First Person Objects GameObject:
  4. The spawn position/rotation now needs to be specified. The best method for determining this value is to pickup the item with the Item Pickup component and then adjust the visible item’s transform while in play mode. Save the position/rotation values and then copy them to the Local Spawn Position and Local Spawn Rotation fields:
  5. Your item has now been setup to be picked up at runtime. This prefab should now be specified within an Item Pickup GameObject so the item can actually be picked up.

Third Person Perspective

  1. Open the Item Manager. Specify the following fields:
    • Name: The name of the item.
    • Item Type: The Item Type that provides a unique id for the item.
    • Slot ID: The slot that the item will occupy.
    • Animator Item ID: Optional, the Item ID used within the Animator.
    • Third Person Object: The object rendered within the game.
    • Action Type: The type of Item Action to add to the item.

    The following screenshot provides a sample setup:

  2. Build the item to a new prefab. Select that prefab within the project.
  3. The spawn parent needs to be specified. For this item we are going to spawn it in the character’s left hand so¬†we ensure Use Parent Humanoid Bone is enabled and then the Left Hand is specified. If this is false then the item will be spawned based on the Slot ID.
  4. The spawn position/rotation now needs to be specified. The best method for determining this value is to pickup the item¬†with the Item Pickup component and then adjust the visible item’s transform while in play mode. Save the position/rotation values and then copy them to the Local Spawn Position and Local Spawn Rotation fields:
  5. Your item has now been setup to be picked up at runtime. This prefab should now be specified within an Item Pickup GameObject so the item can actually be picked up.

Video