> For the complete documentation index, see [llms.txt](https://multicore-games.gitbook.io/smart-doors-and-windows-or-ue5-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://multicore-games.gitbook.io/smart-doors-and-windows-or-ue5-documentation/setup-and-implementation/getting-set-up/locking-system.md).

# 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](/smart-doors-and-windows-or-ue5-documentation/setup-and-implementation/getting-set-up/player-setup.md#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>
