# Locking System

<details>

<summary>How it works</summary>

The locking system works by creating or deleting a "Locked" tag when the Locked variable is changed.

Based on this tag the Player Blueprint can check the Door or Window lock state and display the appropriate message. (See: [Player Interaction System](https://multicore-games.gitbook.io/smart-doors-and-windows-or-ue5-documentation/setup-and-implementation/player-setup#step-3-interaction-system))

</details>

<details>

<summary>Locking Setup</summary>

The Locked variable can be changed in the level by selecting the Door or Window at:\ <mark style="color:green;">Details -> Detection -> Locked</mark>

![](https://238249542-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4oMFO54oVm2ludQTOa3d%2Fuploads%2FuLP4HhPt0i48WdtkpcE1%2Fimage.png?alt=media\&token=8d033636-9091-486d-bf05-fe2aac8223b7)

By DEFAULT, the "Locked" tag and state is changed in the Construction Script based on the Locked variable.

To change the Locked variable in Runtime Blueprint (If you want to create a key or other events), there are the **Lock** and **Unlock** events in the Event Graph.

These events can be called by reference from any other blueprint (Player, key, button, etc.) to Lock or Unlock the door or window based on a certain condition.

![](https://238249542-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4oMFO54oVm2ludQTOa3d%2Fuploads%2FCU8s90oOLDlpoNXjHQIA%2Fimage.png?alt=media\&token=e47a8620-2df6-4370-ac6e-234a60139c30)

</details>


---

# 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://multicore-games.gitbook.io/smart-doors-and-windows-or-ue5-documentation/setup-and-implementation/getting-set-up/locking-system.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.
