# 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="/files/jZEZiUMRj8q8LtqpfK4O" alt=""><figcaption></figcaption></figure>

*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://speedtutoruk.gitbook.io/padlock-system-doc/support/unlock-event.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
