# NavMeshVolume

플레이어의 캐릭터나 NPC, 몬스터가 이동할 수 있는 범위를 지정해주는 NavMesh의 사용법이에요. 🤸‍♀️

NavMesh를 이용하면 장애물(건물, 소품 등)을 피해 이동시킬 수 있어요.&#x20;

샘플맵 바로가기

{% content-ref url="/pages/-MVtfYoN7zHoqLwn7vIV" %}
[Scripting](/ditoland/sample/scripting.md)
{% endcontent-ref %}

## NavMesh 생성하기

월드 트리 - Navigation 의 '+' 를 눌러 NavMeshVolume을 추가해 주세요.&#x20;

![](/files/-MkfiCqr181FB9Eqh1MP)

###

## NavMesh 영역 표시 방법

먼저, 메뉴바의 '**내비 표시**'를 체크해주세요.&#x20;

![](/files/-MkfiIEkOLVL53H6sAAL)

그 다음, NavMesh가 바닥에 닿도록 높이를 조정해 주세요.&#x20;

![](/files/-MkfiLbh_xx6JVKbzjhX)

## NavMesh 영역 지정

NavMesh 안에 장애물 (건물, 소품 등) 을 위치시키면, 자동으로 영역 (연두색 영역) 에서 제외시켜 NPC/몬스터가 장애물을 피해 갈 수 있게 해줘요.&#x20;

![](/files/-MkfiQzEOVtuNckrd6yh)

❗ 경사로와 높이가 다른 층의 NavMesh를 적용하려면 오브젝트의 면적을 충분히 크게 만들어주세요. 너무 작으면 NavMesh가 적용되지 않아요.&#x20;

![](/files/-MkfiUMDygZKJtM_G1hd)

## 캐릭터 /  NPC / 몬스터의 길찾기 이동&#x20;

NavMesh 안에 NPC/몬스터를 위치 시킨 후, MoveToLocation 함수를 이용하면 \
대상을 이동시킬 수 있어요. (NavMesh 안에 위치하지 않으면 이동하지 않아요.)&#x20;

```
--ServerScript에서 
local NPC = Workspace.NPC
local Goal = Workspace.Goal
local GoalPos = Goal.Location  -- 이동할 지점의 위치값을 가져와요. 

wait(0.5) --NavMeshVolume 정보를 처리할 수 있는 잠깐의 대기 시간을 주어요. 
NPC:MoveToLocation(GoalPos) --NPC를 특정 위치로 길찾기 이동해요.
```

## Navigation 프로퍼티

Navigation의 프로퍼티을 통해 NavmeshVolume들의 공통 프로퍼티를 조절할 수 있어요.

![](/files/LXnr1EtGcifLAaaryoGv)

### Navigation 프로퍼티 목록

<table><thead><tr><th width="266.0714285714286">프로퍼티</th><th>설명</th></tr></thead><tbody><tr><td>CellSize</td><td>NevMesh 그리드를 구성하는 복쉘의 크기</td></tr><tr><td>AgentRadius</td><td>영역을 지나갈 수 있는 NPC/몬스터의 최소 반경</td></tr><tr><td>AgentHeight</td><td>이 영역을 지나갈 수 있는 NPC/몬스터의 최대 높이</td></tr><tr><td>AgentMaxSlope</td><td>NPC/몬스터가 이동할 수 있는 최대 기울기</td></tr><tr><td>AgentMaxStepHeight</td><td>NPC/몬스터가 지나갈 수 있는 최대 계단높이</td></tr></tbody></table>

* CellSzie의 값이 작을 수록 NevMesh를 구성하는 복쉘들이 조밀하게 배치돼요.

![](/files/mLTVPMEWjZ6f7AxMpXjG)

## 기타 문의 방법&#x20;

![](/files/-MWcP-8TgALiIzpjrebX)

**다른 개발자들과 다양한 정보를 공유하세요. 디토랜드 운영에게 직접 질문할 수도 있습니다.**

### [**디토랜드 디스코드 바로가기👉**](https://discord.gg/7EugJsh4nX)


---

# 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://ditoland-utplus.gitbook.io/ditoland/manual/navmeshvolume.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.
