> For the complete documentation index, see [llms.txt](https://malbersanimations.gitbook.io/animal-controller/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://malbersanimations.gitbook.io/animal-controller/secondary-components/pickable.md).

# Pickable

Last updated AC v1.5.3

## Overview

This component allows a character to pick and dropped an object. It works directly with the [PickUp-Drop](/animal-controller/secondary-components/pick-up.md) component.

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M_S-JUFRXPuviCYDdch%2F-M_T6bcVf2F8-fpPp5HN%2FNrtnxk4T9i.gif?alt=media\&token=b5b98727-010a-4a6f-9949-77b5be215098)

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2F9Wf2WudfNBRoHZ8nWDtp%2Fimage.png?alt=media&#x26;token=ab5f9b93-801d-424a-a74f-64e50dbdf014" alt=""><figcaption></figcaption></figure>

## Requirements

### Collider

It requires any type of collider(s). This collider must **NOT** be set as a trigger.

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M_aL8lEk3JSrJqAgmmV%2F-M_aLyS_AhLs0lOjeVuj%2Fimage.png?alt=media\&token=3712261c-db55-4469-97f7-ddaade79c7fe)

### Rigidbody (Optional)

If the pickable object has a RigidBody attached, then it can interact with the environment when is dropped.

## How it works

When the character approaches a pickable object, using the PickUp Trigger, it will set as focused a Pickable on the [**PickUp** ](/animal-controller/secondary-components/pick-up.md)component. Then the [**PickUp** ](/animal-controller/secondary-components/pick-up.md)component will have access to all the pickable properties to act accordingly. So you can Pick or Drop an Item:

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2F6AbdAz83QTfwkkOeex7w%2FUnity_tuH9rQ0nJi.gif?alt=media&#x26;token=7c15ab6d-e87f-4b46-bac2-f437d5001ea2" alt=""><figcaption></figcaption></figure>

You can assign any Input to the Main Methods of the Pick Up Component <`TryPickUpDrop()`> These logics will be applied and it will Pick the Item, or drop it if it already has it.

Two or more characters can focus the same item at the same time. The Pickable keeps a set of everyone focusing it, so each focus is tracked separately. One character leaving the trigger does not clear another character's focus.

{% hint style="info" %}
`Focused` stays true until the **last** focuser leaves. Only then does the Pickable invoke `OnFocused(false)` and send a null GameObject on `OnFocusedBy`. While anybody is still inside, the Pickable keeps reporting itself as focused.
{% endhint %}

## Parameters

#### ID

Int value the Pickable Item can store. This ID is used by the Picker component to Identify each Pickable Object.

#### Float Value

Float value the Pickable Item can store.. that it can be used for anything

#### Auto

The Item will be Picked Automatically once is focused by the PickUp Component

#### UseAnimation

The Pick Up Drop Logic will be called via animator events/messages. Use these methods: TryPick(), TryDrop(), TryPickUpDrop()

#### SceneRoot

Unparent the Pickable, so it does not have any Transform parents.

#### Holder

Which holder on the PickUp component the item will be parented to. `-1` uses the Default Holder. A value of `0` or higher is the index of the Extra Holder list.

#### Collectable

When an Object is Collectable it means that the Picker can still pick objects, the item will be collected by another component (E.g. Weapons or Inventory) and it will no longer be an Active Item on the Pick Up Component

#### Destroy On Pick

The Item will be destroyed after is picked. (This Option is only Enabled when Collectable is On

#### RigidBody

Reference for the Pickable RigidBody

#### Colliders

All colliders the Pickable may have

#### CoolDown

The time needed to Pick up the item once it was dropped. OR The time needed to Drop the item once it was picked up.

#### Pick Delay

Delay time after calling the Pick() method. the item will be parented to the PickUp component after this time has passed

#### Drop Delay

Delay time after calling the Drop() method. the item will be unparented from the PickUp component after this time has passed

#### AlignOnPick

This will align the Character to the Pickable Component. It will Rotate the Animal Towards the Item.

#### AlingPos

If set to true, It will also move the character to a radius near the item, using the Distance parameter

#### Distance

Distance or Radius to align the character so it can pick the pickable

#### Align Time

Aligning time to move the character to the correct position for picking the object

## Events

#### OnFocused\<Bool>

Invoked when the Item is focused by a PickUp-Drop Component. Sends true or false if it is focused or not

#### OnFocusedBy\<GameObject>

Invoked when the Item is focused by a PickUp-Drop Component. Sends the PickUp GameObject if is focused or Null if is not

#### OnUnfocusedBy\<GameObject>

Invoked when a PickUp-Drop Component stops focusing the Item. Sends the PickUp GameObject that left. It fires once per focuser, so other characters still focusing the item are not affected.

#### OnPicked\<GameObject>

Invoked when the Item is Picked by a PickUp-Drop Component. Sends the PickUp GameObject

#### OnPickedFailed\<GameObject>

Invoked when a pick was attempted and refused. Sends the PickUp GameObject that tried. It happens when the item is in cool down, when its conditions are not met, or when another owner refuses to release it on a Take Away.

#### OnPrePicked\<GameObject>

Invoked when the Item is Pre-Picked by a PickUp-Drop Component. Meaning the Item is about to be picked up after the Delay Pick time has passed. Sends the Pickable's own GameObject

#### OnDropped\<GameObject>

Invoked when the Item is Dropped by a PickUp-Drop Component. Sends the PickUp GameObject

#### OnPreDropped\<GameObject>

Invoked when the Item is Pre-Dropped by a PickUp-Drop Component. Meaning the Item is about to be dropped after the Delay Drop time has passed. Sends the Pickable's own GameObject

## Reactions

Each Reaction runs a Reaction2 asset right next to its matching event, so the same behaviour can be authored once and reused on every Pickable.

#### Focused By Reaction

Reacts on the PickUp GameObject that focused the item. When the last focuser leaves it reacts on null.

#### Un Focused By Reaction

Reacts on the PickUp GameObject that stopped focusing the item.

#### Picked Reaction

Reacts on the Picker GameObject that picked the item.

#### Pre Picked Reaction

Reacts on the Pickable's own GameObject, before the Pick Delay has passed.

#### Dropped Reaction

Reacts on the Picker GameObject that dropped the item.

#### Pre Dropped Reaction

Reacts on the Pickable's own GameObject, before the Drop Delay has passed.
