> For the complete documentation index, see [llms.txt](https://ditoland-utplus.gitbook.io/ditoland/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ditoland-utplus.gitbook.io/ditoland/api-reference/client/npc.md).

# NPC

## NPC

클라이언트에서 사용되는 NPC 개체에요.

### **함수**

<br>

| **SurfaceUI AddNPCHUD(string UIName, UIScreen UI, UIDisplayType Type)** |
| ----------------------------------------------------------------------- |

UI HUD를 붙일 수 있어요. (붙혀 질 UI 이름, 붙일 UI Screen, [Enum.UIDisplayType.타입](https://ditoland-utplus.gitbook.io/ditoland/api-reference/enums/uidisplaytype) )

\-- 샘플 --

```lua
local npc = Script.Parent
local AddUI = HUD.PlayerNameUI

wait(2)
npc:AddNPCHUD("NameUI", AddUI, Enum.UIDisplayType.Billboard)

local npcNameUI = npc:GetNPCHUD("NameUI")
npcNameUI.Text:SetText("용감한 기사")
```

<br>

| **void RemoveNPCHUD(string UIName)** |
| ------------------------------------ |

UI HUD를 제거해요. (제거하고 싶은 UI 이름)

\-- 샘플 --

```lua
local npc = Script.Parent
local AddUI = HUD.PlayerNameUI

npc:AddNPCHUD("NameUI", AddUI, Enum.UIDisplayType.Billboard)

wait(5)
npc:RemoveNPCHUD("NameUI")
```

<br>

| **void RemoveNPCAllHUD()** |
| -------------------------- |

현재 캐릭터의 모든 UI HUD를 제거해요.

\-- 샘플 --

```lua
local npc = Script.Parent
local AddUI = HUD.PlayerNameUI

npc:AddNPCHUD("NameUI", AddUI, Enum.UIDisplayType.Billboard)

wait(5)
npc:RemoveNPCAllHUD()
```

<br>

| **SurfaceUI GetNPCHUD(string UIName)** |
| -------------------------------------- |

UI HUD를 얻을 수 있어요. (얻고싶은 UI 이름)

\-- 샘플 --

```lua
local npc = Script.Parent
local AddUI = HUD.PlayerNameUI

wait(2)
npc:AddNPCHUD("NameUI", AddUI, Enum.UIDisplayType.Billboard)

local npcNameUI = npc:GetNPCHUD("NameUI")
npcNameUI.Text:SetText("용감한 기사")
```

<br>

| **string GetNPCName()** |
| ----------------------- |

NPC의 이름을 얻을 수 있어요.

\-- 샘플 --

```lua
local NPC = Script.Parent
print(NPC:GetNPCName())
```

<br>

| **void SetNPCName(string Name)** |
| -------------------------------- |

NPC의 이름을 설정 할 수 있어요.

\-- 샘플 --

```lua
local NPC = Script.Parent
NPC:SetNPCName("기사")
```

\ <br>

## **사용 가능한 부모 오브젝트 기능들**

### **속성**

| **이름**                                                                                             | **설명**                  |
| -------------------------------------------------------------------------------------------------- | ----------------------- |
| [**Visible**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/client/characterclient)    | **캐릭터의 가시성**            |
| [**Transform**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/client/characterclient)  | **캐릭터의 Matring 에요**     |
| [**Location**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/client/characterclient)   | **캐릭터 위치값이에요.**         |
| [**Rotation**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/client/characterclient)   | **캐릭터 회전값이에요.**         |
| [**Enable**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)         | **객체 활성화 여부**           |
| [**Transform**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)      | **객체의 Matrix**          |
| [**LocalTransform**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject) | **객체의 Local Transform** |
| [**Location**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)       | **객체의 위치 Vector**       |
| [**LocalLocation**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)  | **객체의 로컬좌표 Vector**     |
| [**Rotation**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)       | **객체의 회전 Vector**       |
| [**LocalRotation**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)  | **객체의 로컬 회전 Vector**    |
| [**Scale**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)          | **객체의 크기 Vector**       |
| [**Visible**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)        | **객체의 가시성**             |

### **이벤트**

| **이름**                                                                                             | **설명**                                                                                                                       |
| -------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| [**OnUpdateEvent**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)  | <p><strong>생성 후 매 프레임마다 호출되는 이벤트에요.</strong><br><strong>연결함수 형식은 function(updateTime), updateTime 은 number 입니다.</strong></p> |
| [**OnDestroyEvent**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject) | <p><strong>삭제될 때 호출되는 이벤트에요.</strong><br><strong>연결함수 형식은 function() 입니다.</strong></p>                                       |
| [**OnEnableEvent**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)  | <p><strong>Enable 될때 호출되는 이벤트에요.</strong><br><strong>연결함수 형식은 function() 입니다.</strong></p>                                   |
| [**OnDisableEvent**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject) | <p><strong>Disable 될때 호출되는 이벤트에요.</strong><br><strong>연결함수 형식은 function() 입니다.</strong></p>                                  |

### **함수**

| **이름**                                                                                                                  | **설명**                                                                                        |
| ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| [**AddAnimStateMachine**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/client/characterclient)             | **Game:AddAnimStateMachineSetting로 추가된 상태 머신 중 애니메이션 상태 머신을 추가해요. (추가할 상태 머신 이름)**            |
| [**GetAnimStateMachine**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/client/characterclient)             | **해당 애니메이션 상태 머신을 얻을 수 있어요. (얻고싶은 상태 머신 이름)**                                                 |
| [**GetCurAnimState**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/client/characterclient)                 | **현재 애니메이션의 상태를 얻을 수 있어요.**                                                                   |
| [**ChangeAnimState**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/client/characterclient)                 | **해당하는 애니메이션의 상태로 변경할 수 있어요. (변경하고 싶은 애니메이션 상태 이름)**                                          |
| [**ChangeAnimState**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/client/characterclient)                 | **해당하는 애니메이션의 상태로 변경할 수 있어요. (변경하고 싶은 애니메이션 상태 이름, 블렌딩 시간)**                                  |
| [**ChangeAnimStateMachine**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/client/characterclient)          | **해당 애니메이션 상태 머신을 변경할 수 있어요. (변경하고 싶은 상태 머신 이름)**                                             |
| [**PlayAnimWithExpression**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/client/characterclient)          | **해당하는 애니메이션의 상태와 표정으로 변경할 수 있어요(상태가 변경되면 표정도 재생을 중지해요).**                                    |
| [**SetCharacterFaceExpression**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/client/characterclient)      | **캐릭터의 표정을 재생해요.**                                                                            |
| [**StopCharacterFaceExpression**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/client/characterclient)     | **캐릭터의 표정 재생을 취소해요.**                                                                         |
| [**AttachObject**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/client/characterclient)                    | **캐릭터에 타겟 오브젝트를 붙일 수 있어요. (타겟 오브젝트, 붙일 AttachPoint)**                                         |
| [**AttachObject**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/client/characterclient)                    | **캐릭터에 타겟 오브젝트를 붙일 수 있어요. (타겟 오브젝트, 붙일 Bone)**                                                |
| [**DetachObject**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/client/characterclient)                    | **캐릭터에 붙어있는 오브젝트를 떨어뜨릴 수 있어요. (타겟 오브젝트)**                                                     |
| [**DetachAllObject**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/client/characterclient)                 | **캐릭터에 붙어있는 모든 오브젝트를 떨어뜨려요.**                                                                 |
| [**GetKey**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)                              | **객체의 키 값을 얻을 수 있어요.**                                                                        |
| [**SetTransformWithCollisionCheck**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)      | **현재 매트릭스에서 설정 된 매트릭스로 보간이 되는 매트릭스를 설정할 수 있어요 설정할 수 있어요. (Matrix 값, bool 충돌 처리 여부)**          |
| [**SetLocalTransformWithCollisionCheck**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject) | **현재 매트릭스에서 설정 된 매트릭스로 보간이 되는 매트릭스를 로컬좌표기준으로 설정할 수 있어요 설정할 수 있어요. (Matrix 값, bool 충돌 처리 여부)** |
| [**Teleport**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)                            | **순간이동 하는 매트릭스를 설정할 수 있어요. (Matrix 값)**                                                       |
| [**SetLocationWithCollisionCheck**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)       | **객체의 위치를 설정할 수 있어요. (설정할 위치 Vector 값, 충돌 처리 여부)**                                            |
| [**SetTag**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)                              | **객체의 tag를 설정해요. (설정할 tag)**                                                                  |
| [**GetTag**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)                              | **객체에 설정된 tag를 얻을 수 있어요.**                                                                    |
| [**ConnectEventFunction**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)                | **유저가 추가한 오브젝트 커스텀 이벤트에 함수를 연결할 수 있어요. (이벤트 이름, 연결 함수)**                                      |
| [**LookAt**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)                              | **오브젝트가 해당하는 위치를 바라보게 할 수 있어요. (바라볼 위치 Vector)**                                              |
