This tutorial will provide the minimum setup instructions required settings to make an NPC intractable.
An empty example scene is prepared with a player controller and an non-player animated model for NPC Chat tutorials, you can find this scene in the following location:
|Assets\TurnTheGameOn\NPC Chat\Example Scenes\NPCChat_ExampleScene|
- Assign the “Player ThirdPersonController” object from the scene as the Player (Transform) reference in the NPC Chat inspector.
- Add a name for the NPC to the Title Text field and some dialogue in the Dialogue Text field in the NPC Chat inspector. That’s it for configuring NPC Chat, next we’ll customize the chat box a little.
- If you brought the Chat Box into the scene as a prefab, you’ll need to unpack it to customize it. Right click the object and select Unpack Prefab Completely to create a unique object that you can customize and save as your own prefab.
- You can customize this chat boxes UI components however you like with new sprites, dimensions or other components. In this tutorial I will disable the buttons, player name input field, and enable the Portrait RawImage (to render the NPC’s animation).
- The last step would be to move and position the Render Texture Camera used for the Portrait RawImage to the NPC animated model in the scene. You may want to adjust this camera orientation through trial and error after testing play mode.