Add Headings and they will appear in your table of contents.
Youtube dialog system
Prepare NPC from mixamo
Import your npc to unity
Change the animation type to humanoid
Change the animation type to humanoid
drag animation to the animator
add the animator to your npc to enable npc is animated
create panel
on the 2d view
rescale the dialog panel
create text for your dialog
key in the text for your dialog
create button
create 4 buttons A to D
select the text and write your option text
choose player amarture and uncheck the mouse cursor locked
and cursor Input for Look
prepare two type for collider, box collider, then tick the isTrigger, to make sure when the player enter the area, the panel will show
button click setting
attached this script to your npc
using UnityEngine;
using UnityEngine.UI;
public class Talk2NPC : MonoBehaviour
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
public GameObject talkPanel;
private void Start()
{
talkPanel.SetActive(false);
}
public void OnTriggerEnter(Collider other)
{
//if(other.CompareTag("Player") && Input.GetKeyDown(KeyCode.E))
if (other.CompareTag("Player"))
{
talkPanel.SetActive(true);
Debug.Log("enter trigger");
}
}
public void OnTriggerExit(Collider other)
{
if (other.CompareTag("Player"))
{
talkPanel.SetActive(false);
}
}
public void chooseA()
{
Debug.Log("you choose A");
}
public void chooseB()
{
Debug.Log("you choose B");
}
public void chooseC()
{
Debug.Log("you choose C");
}
public void chooseD()
{
Debug.Log("you choose D");
}
}