# 비헤이비어와 컴포넌트

![](/files/-MhWtMttRCU4Myi7AlgZ)

비헤이비어와 컴포넌트는 오브젝트에 추가할 수 있는 **사전 정의된 로직 모음**으로 경험에서 오브젝트가 플레이어나 다른 오브젝트와 연관되는 사항을 제어하는 **다양한 변수**를 제공합니다.

오브젝트를 **이동**하거나 같은 장소에 머물게 하며, 나타나거나 **사라지고**, 싸우거나 도망가고, 메시지를 받거나 전송하고, **활성화**하거나 비활성화할 수 있습니다.

가령, 기본적으로 **Prey (먹잇감)** 비헤이비어가 적용된 애셋은 **Predator (포식자)** 행동이 적용된 애셋으로부터 **자동적으로 달아나게 됩니다**. 마찬가지로 Predator (포식자)는 자동적으로 주변을 돌아다니는 Prey (먹잇감)을 찾아 공격하게 됩니다.

{% hint style="info" %}
이 아카데미 내 [비헤이비어](https://sandboxgame.gitbook.io/the-game-maker-academy_kr/behaviours/what-is-a-behaviour)와 [컴포넌트](https://sandboxgame.gitbook.io/the-game-maker-academy_kr/components/what-is-a-component) 섹션을 참고하여 더 자세히 알아보세요.
{% endhint %}

여기서 중요한 것은 **로직 사용**은 어려운 작업이 아니라는 사실입니다. 이는 단지 행동과 결과, **원인과 효과** 간의 관계 설정을 어떻게 하는가의 문제입니다.

이 단계에서 여러분은 "*말은 쉽지, 어떻게 해야 하지?*"라고 의문을 가질지도 모르겠습니다. 걱정하지 마세요. 이어서 **트리거와 메시지**에 대한 내용을 다룬 페이지로 넘어가 어떻게 로직 시스템을 적용하고 수정해야 할지 알아보겠습니다.


---

# 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://docs.sandbox.game/the-game-maker-academy_kr/logic/behaviours-and-components.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.
