# Unlock Event

### What happens **when the code is valid?**

{% hint style="info" %}

1. Click the **+** icon in the bottom right, it will add a new event and you can place any gameobject which may have a script with a public method you want to call.&#x20;
2. In this case I have added the door object, this has a script called **DoorController** which has a public method called **OpenDoor**
3. You can then run this code each time you unlock something, this can be changed on each door, and multiple events can happen in each
   {% endhint %}

### Event Example

{% hint style="info" %}

* In the example below you can see the event opens from the script **DoorController**&#x20;
* The **DoorController** exists on the door object itself.
  {% endhint %}

<figure><img src="https://3807630089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7GiPc_l1RUpLjZfGG%2Fuploads%2F2UX1rrUqdSeYIsO1DV7x%2FKeypadUnlockEvent.JPG?alt=media&#x26;token=01973cba-6148-4de2-9fdb-4d13d88ebf8f" alt=""><figcaption></figcaption></figure>

### Stopping Keypad Interactions

{% hint style="info" %}
I have also added a **RemoveTag** script in case you want to remove the tag to stop interaction with the keypad once you get a specific code. (This stops you from interacting with keypads after, if you wish)

* See the **Scripts > Event Examples** folder
  {% endhint %}

{% content-ref url="stopping-interaction" %}
[stopping-interaction](https://speedtutoruk.gitbook.io/keypad-system-doc/support/stopping-interaction)
{% endcontent-ref %}
