Quick Start Guide
Last updated
Last updated
Performing these steps creates an NPC Chat object that is triggered by left-mouse clicking over the box collider. This object was positioned to be around a stationary NPC object, but you can also attach it to the NPC so if the NPC moves, the dialogue goes with it.
Open the Tutorial scene:
Assets\TurnTheGameOn\NPCChat\Tutorial
Add an NPCChat prefab to the scene:
Assets\TurnTheGameOn\NPCChat\Prefabs\NPCChat\
Add a ChatBox prefab to the scene:
Assets\TurnTheGameOn\NPCChat\Prefabs\ChatBox\
Select the NPCChat prefab in the scene.
Assign the ChatBox prefab to the NPC Chat - Chat Box inspector field.
Type some text in the NPC Chat Text inspector field.
Press the Add Component button and type TriggerChatOnMouseDown in the search field and select it, enable the option Mouse Over To Start.
Press the Add Component button and type Box Collider in the search field and select it, change the Box Collider Size Y to 2.
Set the Transform Position to -0.85 X 1 Y 0 Z
Press play, mouse-over the NPC in the scene and click the left mouse button.
This workflow is the core idea of NPC Chat, it will allow you to place NPC Chat objects anywhere in your scenes to create reusable, interactive prefabs, and use it in an object oriented way.