> For the complete documentation index, see [llms.txt](https://docs.sandbox.game/the-game-maker-academy_kr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sandbox.game/the-game-maker-academy_kr/tutorials-1/beginner-tutorials/door-and-key-systems.md).

# 문과 열쇠 시스템

이 튜토리얼에서는 문의 작동 방식과 열쇠 사용, 아이템 수집, 버튼 누르기 등을 통해 잠긴 문을 여는 다양한 시스템에 대해 알아보겠습니다.

* **L** 키를 눌러 애셋 라이브러리를 열고 원하는 문을 선택합니다.
* 바닥에 놓고 선택한 뒤 '**Door Behaviour**'가 포함되어 있는지 확인합니다.
* **'Edit Logic'** 버튼을 클릭하여 모든 설정을 확인합니다.

'**Message Required**' 메뉴에 **Interact**, **Trigger**라는 두 가지 메시지를 확인할 수 있습니다. **Interact**는 플레이어가 주변 월드와 상호작용하기 위한 기능으로 기본 E 버튼으로 설정되어 있습니다. **Trigger**는 버튼의 기본 메시지로 버튼이 눌리면 문에 영향을 주게 됩니다. 이 두 메시지를 삭제하면 문은 열리지 않습니다.

![](/files/-MP82x3wFiY8XKYqvHn8)

열쇠를 획득했을 때만 문이 열리도록 하려면 어떻게 해야 할까요?

* 문을 선택한 후 '**Door Behaviour**' 밑에 '**Message Required**'에 하나의 메시지를 넣을 수 있습니다. 이 예시에서는 메시지로 '**key1**'을 사용했습니다.

![](/files/-MP86HieBEwROkjKI1vb)

* 애셋 라이브러리에서 열쇠 애셋을 가져옵니다.
* 선택 후 '**Collectable Component'**&#xC5D0; 추가합니다.
* 열쇠가 화면에 표시되면 **'Edit Logic'** 버튼을 클릭합니다.
* **'Collect Message'**&#xB97C; **'key1'**&#xC73C;로 변경합니다.

게임을 테스트할 때 문을 열 수 있는 열쇠를 모을 수 있어야 합니다.

![](/files/-MP86_Qh2_eMnJO3B2WE)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.sandbox.game/the-game-maker-academy_kr/tutorials-1/beginner-tutorials/door-and-key-systems.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
