⚙️
FPS Framework
Asset StoreFab
  • Get Started
    • Welcome!
    • Setup
  • Tutorials
    • Character
      • First-Person Controller
      • Inventory
      • Firearm
        • Basics
        • Advanced
        • Other
          • Spray pattern
          • Attachment System
          • Projectile System
      • Explosive
    • Systems
      • Audio System
      • Animation System
      • Interactions
        • Pickable
      • Save System
      • Settings System
    • Tools
      • Extension Methods
    • UI
      • FPS Counter
      • Get Name
      • Image Size Fitter
  • Other
    • Full Change Log
      • 2025 Change Log
      • 2024 Change Log
      • 2023 Change Log
      • 2022 Change Log
Powered by GitBook
On this page
  • Creating A Pickable
  • Item Pickables
  • Collectable Pickables

Was this helpful?

  1. Tutorials
  2. Systems
  3. Interactions

Pickable

A component responbile for handling pickable items.

PreviousInteractionsNextSave System

Last updated 2 months ago

Was this helpful?

The Pickable component is an interactable component responsible for adding the target item to your inventory. The item can be either a collectable or an inventory item:

  • Collectable items include things like ammo.

  • Inventory items include firearms, throwables, and other usable items.

When the player interacts with an object that has the Pickable component, it will be added to their inventory according to its type.

Creating A Pickable

To create a new Pickable item, follow these steps:

  1. Create an empty GameObject.

  2. Attach the Pickable component to the GameObject.

  3. Set the layer of this GameObject to "Interactable" to ensure it can be interacted with.

This setup allows the item to be picked up and added to the player's inventory when interacted with.

As shown above, a cube is created for visualization purposes, with the Pickable component attached, the layer set to "Interactable", and a Box Collider added. This setup allows you to visually see the pickable item in the game scene and ensures that it is properly interactable when the player approaches it.

Item Pickables

To create a pickable item, the field "Type" must be set to "Item"

With this setup complete, if you enter play mode and try to interact with the item, you may see a warning message saying "Pickable is inactive or item is null...". This happens because the item is not assigned yet. To fix this, assign an Inventory Item to the "Item To Pickup" field.

The pickable item now is working as intended.

Collectable Pickables

To create a collectable pickable, the field "Type" must be set to "Collectable"

By setting the field "Type" to "Collectable", the inspector of the Pickable component changes as seen below.

As seen above, there are two fields: "Collectable Identifier" and "Amount To Collect".

  • Collectable Identifier functions as the item to pick up, but specifically for collectables (like ammo).

  • When the item is picked up, the system searches the inventory for a matching collectable.

  • If found, it increases the collectable’s Count by the value set in "Amount To Collect".

As seen below, the Inventory has a list called "Collectables", which is what the Collectable Pickable interacts with. When a collectable item is picked up, it searches this list to find a matching identifier and adds the specified amount to it.

This only works if the Collectable Identifier in the Pickable component matches one of the Collectable items in the Inventory's Collectables list. If there's no match, the item won't be added when picked up.

You can assign the firearm you created following the page, any of the default firearms, or throwables. For this example, you can use the default Assault Rifle_1.

Basics