# Adding Trigger Event

### Creating A Trigger Event

{% hint style="info" %}

1. Create a box or other 3D Object to act as your trigger - make sure this object has a collider set to **IsTrigger**
2. Add the **PadlockTrigger** script to that 3D object and add the padlock controller object to the inspector slot named **PadlockController**
   1. By default the interaction key is set to **E**
      {% endhint %}

<figure><img src="https://2236607572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbcA6suFQtgZxhgZbYp%2Fuploads%2FZ8yiws1ODpenTrFx45vM%2FTrigger.JPG?alt=media&#x26;token=91509233-0187-46bb-a6a4-2b4f4356412a" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
3\. In the **PadlockController** script make sure to:&#x20;

1. Tick **IsPadlockTrigger**
2. Add the Padlock Trigger GameObject to the TriggerObject slot
   {% endhint %}

<figure><img src="https://2236607572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbcA6suFQtgZxhgZbYp%2Fuploads%2FpEK08UTLaEM0Fu9MyLwJ%2FTriggerController.JPG?alt=media&#x26;token=2aa723c5-98f9-45f6-8afb-b14b011f1ad6" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
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.
{% endhint %}
