> 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/collecting-objects-to-heal-or-damage.md).

# 회복하거나 데미지를 줄 오브젝트 모으기

이 튜토리얼에서는 플레이어를 회복시키거나 데미지를 줄 코인을 모으는 방법에 대해 알아보겠습니다.

* **L** 키를 눌러 라이브러리를 열고 플레이어가 모으게 할 애셋을 선택하고 놓습니다. 이 예시에서는 코인을 사용했습니다.
* '**Collectable**' 컴포넌트를 추가합니다.
* 우측의 '**Edit Logic**' 버튼을 클릭하고 추가 설정을 불러옵니다.
* '**Collect Message**'에 원하는 문구를 넣습니다. 이 예시에서는 '**coin**'을 사용했습니다.

![](/files/-MTkDKaNa9zYDsL9X10w)

이제 플레이어가 코인으로 달려가면 자동으로 수집되며 '**coin**'이라는 메시지가 표시됩니다. 이제 메시지를 받고 필요한 액션을 할 무언가를 만들어야 합니다. '**Damage**' 또는 '**Healing**'입니다.

* '**Acoin**' 해당 코인의 복사본을 만들어 '**투명**'하게 설정 후 찾기 쉽도록 이름을 붙입니다. 이 예시에서는 투명한 코인을 '**Acoin invis**'라고, 다른 코인을 '**Acoin**'이라고 이름지었습니다.
* 투명한 코인에 '**No collisions**'를 설정합니다.

![](/files/-MTkET4I_C-zbfPRxeTi)

* '**Message Broadcaster**' 행동을 추가하고 **Visible** 을 **False**로 설정합니다.
* **'Message to Send' -** 여기에서 컬렉션이 데미지를 줄지 회복을 줄지 결정합니다.\
  **Damage:10** 또는 **Heal:10** - 대소문자를 구분하고 공백없이 붙여 씁니다. 숫자는 원하는 대로 변경할 수 있습니다.
* '**Wait Before Broadcast**'를 **True**로 설정합니다.
* **Message Required**에 '**coin**'을 설정하거나 코인 대체로 사용한 애셋 이름을 넣습니다.
* **Broadcast Only Once**를 **True**로 설정하고 **Delay**에 **1**을 입력합니다.

![](/files/-MTkFcht7FlmEr9TLORi)

마지막으로 수집 가능 코인을 투명한 코인의 부모로 설정해야 합니다. 코인을 모으면 화면에서 사라지며 메시지 브로드캐스터도 함께 가져갑니다.

* 화면 왼쪽 아래 코너의 'Hierarchy' 버튼을 클릭합니다.
* 조금 전 사용한 이름으로 검색합니다. 검색창에 '**Acoin**'을 넣으면 두 가지 코인이 모두 표시될 것입니다.&#x20;
* 'Acoin invis'을 'Acoin'으로 드래그하여 놓아 수집 가능한 코인을 투명한 코인의 부모로 설정합니다.

![](/files/-MTkHCTu3hhYNE97j2Hx)

모두 완료되었습니다! 이제 플레이어에게 데미지나 회복을 주는 수집 가능한 코인을 생성했습니다.


---

# 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/collecting-objects-to-heal-or-damage.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.
