# NPC Chat

{% embed url="<https://youtu.be/FUFdVDveUAM>" %}

**NPC Chat** is a script that can be added to objects your scenes to display UI text and/or trigger custom events. The UI text is displayed through a configurable **Chat Box prefab** made of Unity UI components including Images(chat box frame and icon), Raw Image(animated portrait using render texture from camera), Text Mesh Pro UGUI Text(display name and text), Buttons(assign custom sequences through button events).\
\
The NPC Chat script allows you configure a number of settings via the inspector just like other common Unity components.\
\
**NPC Chat Features:**\
• API: StartChat, FinishPage, StopChat\
• Header Text (NPC Name)\
• Body Text (NPC Dialogue)\
• Audio Clip\
• Any Number of Pages\
• Use Unique Chat Boxes on each page\
• Chat Start Event\
• Chat Stop Event\
• Page Start Event\
• Page Stop Event\
• Page Buttons (up to 6)\
• Play On Awake option\
• Scrolling Text option\
\
**Chat Box Features:**\
• Made from Default Unity UI Components\
• Header Text (NPC Name)\
• Body Text (NPC Dialogue)\
• Preconfigured Render Texture Camera enabled/disabled with chat box\
\
**Additional Components** can be added to the NPC Chat object for added functionality and control:\
• DistanceCheck\
• MouseOverOutline\
• TriggerChatOnCollision\
• TriggerChatOnKeyDown\
• TriggerChatOnKeyUp\
• TriggerChatOnMouseDown\
• TriggerChatOnMouseUp


---

# 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://npcchat.turnthegameon.com/master.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.
