> For the complete documentation index, see [llms.txt](https://eis-2.gitbook.io/easy-interaction-system/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://eis-2.gitbook.io/easy-interaction-system/creating-new-interactions.md).

# Creating new interactions

Let's create a new simple pick-up interaction, that will use [Inventory System](/easy-interaction-system/additional-systems/inventory-system.md).

1. Create a new script. For more convenience end it with Interactable or Interaction.

<figure><img src="/files/fg3lzYZ0HaAmanBkfMho" alt=""><figcaption></figcaption></figure>

2. Extends from `Interactable`

<figure><img src="/files/WDNdjfjzi7Whco0kcoQv" alt=""><figcaption></figcaption></figure>

> You will see red line, which indicate that scripts contains errors. That's right, once we extend from `Interactable`, we need to implement some base methods.

3. &#x20;Implementing required methods

<figure><img src="/files/x0mjCzl6VwnSIDLTVwJp" alt=""><figcaption></figcaption></figure>

```csharp
public override bool UsePrimaryActionHint() => true;
public override string GetPrimaryHintText() => "Pick object";

public override bool UseSecondaryActionHint() => false;
public override string GetSecondaryHintText() => default;

public override bool IsUnsubscribeBlocked() => false;
```

We only need primary action for this interaction, so we set `UsePrimaryActionHint()` to return true, and also make `GetPrimaryHintText()` return hint text "Pick object".

For `UseSecondaryActionHint()` and `GetSecondaryHintText()` we return default values.

Also, we need to override `IsUnsubscribeBlocked()`, but, because we don't want to block interaction, we return false.

4. Now, let's override `OnInteractPrimary()` and add some logics to it.

Also, we created a new field, `inventoryItemData` to set it from inspector.&#x20;

```csharp
[SerializeField] private InventoryItemData inventoryItemData;
```

```csharp
public override void OnInteractPrimary()
{
    InventoryController.AddToInventory(inventoryItemData);
    Destroy(gameObject);
}
```

&#x20;

5. Ok, we have created script. Now, let's setup it in Unity

Create new gameobject, or drop from project tab.&#x20;

{% hint style="warning" %}
**It's important to have an mesh renderer on object. Also, remember to add and collider, of any type**
{% endhint %}

Change layer, from default to `Interactable`

<figure><img src="/files/pK2vxvDUX4Xu3x4rcwCw" alt="" width="453"><figcaption></figcaption></figure>

Add `Outline` component to object, and disable it (we don't need that outline to be visible at start)

<figure><img src="/files/TCq4VGw5Py3oIWzPbK1p" alt=""><figcaption></figcaption></figure>

Finally, add our interaction `PickUpInteractable`, and set inventory item data with and corresponding item

<figure><img src="/files/GJf8JMYZMcrxyCINsZWj" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Congrats :tada:. You created your first interaction. To get more information about interaction creation, and what you can do, see [Interaction anatomy](/easy-interaction-system/creating-new-interactions/interaction-anatomy.md)
{% endhint %}
