# Unlock Event

### **How to change the unlock event code when the door opens**

{% hint style="info" %}

1. In the **PadlockController** script object  - In the **Unlock Events** section towards the bottom.&#x20;
   1. This uses **UnityEvents** which allows you to click the **+** icon in the bottom right
   2. You can add any GameObject into the appropriate slot and any script which has a public method, will allow this to be run.
      {% endhint %}

### Example in the Demo Scene

{% hint style="info" %}

1. I have an example in the demo scene, which references the Door Object, which has the script **STDoorController**
2. Within this controller there is a method called **OpenDoor** - Which just activates either an animation or door rotation on an axis
   {% endhint %}

<figure><img src="https://2236607572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbcA6suFQtgZxhgZbYp%2Fuploads%2FPn8xqqDrG93M7vzRbsLV%2FUnlock%20Event.JPG?alt=media&#x26;token=b09ebcfa-a3da-4e8d-8516-17e5b92431f4" alt=""><figcaption></figcaption></figure>

*
