# Adding Trigger Event

### Setting Up Trigger Object

{% hint style="info" %}

1. Create a box or other 3D Object, make sure this object has a collider set to **IsTrigger**
2. Add the **CodeDeviceTrigger** script to that 3D object and add the keypad object to the inspector slot named **Keypad Object**. (The keypad object will have the script **CodeDeviceItem**)
3. Then set an input key you’d like to use for the interaction, by default set to **E**
   {% endhint %}

<figure><img src="https://3807630089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7GiPc_l1RUpLjZfGG%2Fuploads%2F7oW6RA18GjaFfrUnbqws%2FTrigger.JPG?alt=media&#x26;token=3f8c0f26-4260-422a-a5ed-0e3525a13a9c" alt=""><figcaption></figcaption></figure>

### Enable Trigger in Controller

{% hint style="info" %}
4\. At the bottom of the **Controller** script make sure to tick **TriggerEvent** to true at the bottom of the inspector and then add the **TriggerEvent** object into the slot that appears.
{% endhint %}

![](https://3807630089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7GiPc_l1RUpLjZfGG%2Fuploads%2FwPqXjs56XN2dRSUL3gKv%2FControllerTrigger.JPG?alt=media\&token=b3dee3cc-6798-46ee-8a54-7cf492400311)

### Demo Scene Examples

{% hint style="info" %}

* Remember to take a look at the demo scene if you have any troubles, it might give you an idea on how to fix an issue! If you find the package helpful
  {% endhint %}
