Unity 5 | NPC Basic Interaction Tutorial

preview_player
Показать описание
Learn how to make a basic NPC System in Unity 5 using the Canvas/UI system!

Subscribe! It's Free!

Рекомендации по теме
Комментарии
Автор

i realized at like 45 seconds that this was way too advanced for me, but you're presentation was awesome and ima save this vid for when I can hopefully keep up. Thanks a ton for making this man, one day it'll help me out a metric shit-ton!

everysoorphan
Автор

For those who wants a trigger mechanic to work use this


private void OnTriggerStay2D(Collider2D other)
{
if
{
if (Input.GetKeyDown("e"))
{
// only load if in range and not already loaded
if (inRange && !inChat)
{

= greeting;
loadDialogue1();
}
}
}
}

public void OnTriggerExit2D(Collider2D other)
{
CloseDialogue();
}

hamzahpro
Автор

Question, i'm using your script and it works great! my problem: i have this script on multiple npc's. and in the inspector i type different dialogues for each npc. But in the end it always goes with the dialogue options of the first npc i tried the script with, any ideas?

thnx!

bonoke
Автор

How do I change the range so the dialogue only works when the player is close to the camera?

lufclife
Автор

There are so many better ways to do this though

Just to say though, it's nice to have the text "tickertape"

Just have whenever you set the UI's response text set, change it from

= //blahblah

To

chatTextString = response;

Then set the UI text in an IEnumerator that gets called in Start, like so...

public float delay = 0.1f;
int currentPosition;
void Start()
{
StartCoroutine ("StartTextDisplay");
}

IEnumerator StartTextDisplay()
{
while (true)
{
if (currentPosition < chatTextString.Length)
+=

yield return new WaitForSeconds (delay);
}
}

memorymod
Автор

I did what yoou said but my buttons dont work, can I have some help?

rebeccarodnitzky
Автор

Hell to practice i am using capsules o.o

Yushikime
Автор

thank you for this tutorial, was looking for something like this may i suggest a tutorial with dialog system + Timeline/Cinemachine (nothing complicated of course ^^) like the ones in Deus EX franchise ? anyway you Rock   XD

zaam
Автор

Hey, how come I can't click the buttons?

sonorityscape
visit shbcf.ru