How to make a Dialogue System in Unity

  Рет қаралды 912,471

Brackeys

Brackeys

Күн бұрын

Let’s make a Dialogue System that you can easily tweak to suit your game!
● Listen to the Podcast: bit.ly/2un4o0m
● Download the Project: bit.ly/2t45YYc
● Download the Font: www.dafont.com/6809-chargen.font
● Singleton: wiki.unity3d.com/index.php/Sin...
❤️ Donate: www.paypal.com/donate/?hosted...
····················································································
► Join Discord: / discord
♥ Subscribe: bit.ly/1kMekJV
● Website: brackeys.com/
● Facebook: / brackeys
● Twitter: / brackeystweet
········································­­·······································­·­····
Edited by the lovely Sofibab.
········································­­·······································­·­····
► All content by Brackeys is 100% free. I believe that education should be available for everyone. Any support is truly appreciated so I can keep on making the content free of charge.
········································­­·······································­·­····
♪ "Funin and Sunin" Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 3.0 License
creativecommons.org/licenses/b...
♪ Baby Plays Electro Games
teknoaxe.com/cgi-bin/link_code...

Пікірлер: 1 200
@micahgoins4918
@micahgoins4918 2 жыл бұрын
10:50 ATTENTION!! if using a newer version of unity and you try to use "Text - TextMessagePro" it will not work!! to get the code to work just change the "public Text nametext;" variable to "public TextMeshProUGUI nametext;" and do the same for the dialogue text variable!
@micahgoins4918
@micahgoins4918 2 жыл бұрын
also at the top put "using TMPro;"
@mroliveoil
@mroliveoil 2 жыл бұрын
duly noted
@ladarriuscaldwell7577
@ladarriuscaldwell7577 Жыл бұрын
Thank you! this is the issue I was just having!!!
@tramsroy2961
@tramsroy2961 Жыл бұрын
Lifesaver!! thank you, I couldn't figure out for the longest time
@thanhatnguyen8137
@thanhatnguyen8137 Жыл бұрын
Hi pro, I try on two box collider used OnTriggerEnter, but only 1 dialogue show, help me, thanks
@sdk2n
@sdk2n 4 жыл бұрын
I just finished the video, and “dialogue” doesn’t sound like a real word anymore.
@riyazsaifi4060
@riyazsaifi4060 4 жыл бұрын
Yeah it's one-sided dialogue 🤣😂😅
@crgamedev734
@crgamedev734 4 жыл бұрын
Same here I used dialogue so much I forgot how to spell it
@ibhauptmann98
@ibhauptmann98 4 жыл бұрын
I think there is a name for that phenomenon, where something is reapeted, and starts to not sound like word. Another word that iv'e noticed this happens a lot on is speech.
@David-vz4yk
@David-vz4yk 4 жыл бұрын
Ib Hauptmann happend to me when i watched a tutorials about door keys by code monkey
@hantao2115
@hantao2115 4 жыл бұрын
@@ibhauptmann98 semantic satiation
@kavyaagrawal2013
@kavyaagrawal2013 3 жыл бұрын
"Let's just delete Linda for now.." Person named Linda: Guess I'll die
@Enderia2
@Enderia2 4 ай бұрын
5:43 lol
@pixaxgt8724
@pixaxgt8724 6 жыл бұрын
Those tutorials are better than them you paying for... Thank you Brackeys for doing this
@Ian640
@Ian640 6 жыл бұрын
@MeebleMeeble it would help if you would post a link to the official Unity video you're talking about so those of us can compare the foundation Brackeys gave us with a more advanced example like what you're mentioning. I did a quick search over the unity channel and I haven't seen anything focused on Dialogue. I found a few that touched on the subject but talked more about interactivity than what Brackeys has shown.
@BoundfoxStudios
@BoundfoxStudios 6 жыл бұрын
you mean the courses? yeah many courses are very shit :D
@Ian640
@Ian640 6 жыл бұрын
+MeebleMeeble Thanks for posting the link! From what I understand Brackeys is all about, for the mass population that tell themselves "Oh man I _wish_ I could make a game but don't know how..." Brackeys creates a strong, understandable, readable foundation that really rolls out the red carpet to the juicy center of Unity, Game Development, and Scripting's full potential. I think Asbjørn himself mentioned within his podcast linked in this video the history of Brackeys and the purpose as to why it was made, and why the format is now what it is. It's a cool history :D I also believe that he and Sofie (Sofibab? Sofi?) read the comments almost feverishly so they can see what they can do better to increase the quality of content put out, so mentioning the scrolling text reformatting itself could invoke another video, or start an entire "Dialogue pt 2", which would be super awesome as I love dialogue systems myself. On another note, much of learning code in general is a self endeavor. To be able to solve problems that appear before you that you can solve yourself is challenging and rewarding at the same time! Although Brackeys didn't mention how to solve the re-aligning of text printing to the game, doesn't it make you curious how you could solve it yourself, now that you know how to code such a system and understand the imput it takes? :) It intrigues me!
@jacoblynam923
@jacoblynam923 6 жыл бұрын
totally agree! This dude is a stud!!!
@GamexTRon
@GamexTRon 5 жыл бұрын
Put in the simplest way, Brackeys helps you more to understand the logic and algorithm while unity courses are more flexible coding wise.
@-_IT_-
@-_IT_- 2 жыл бұрын
Its sad that this channel has stopped making new videos. These are extremely helpful videos.
@gabrielm5087
@gabrielm5087 4 ай бұрын
ther's adiscord now
@Cardinal_
@Cardinal_ Ай бұрын
guess what
@UnchallengedGaming
@UnchallengedGaming 16 күн бұрын
He's BACK!
@leowilbur4024
@leowilbur4024 9 ай бұрын
Incredibly sad that the channel is no longer making these 😭, I've just finished completing a dialog system adapted from the above ☹. Thank you Brackey's for everything you've done for the indie gaming community!
@xenothym
@xenothym 4 жыл бұрын
Thank you for this nice tutorial! I paused the game during the dialogue. For those of you who want to do the same, set the Update Mode of the Animator to "Unscaled Time", then instead of "yield return null" use "yield return new WaitForSecondsRealtime(typingSpeed)" where typingSpeed is a float variable storing the time delay between the appearance of the characters. Finally, all that is left to do is to set "Time.timeScale = 0" in the StartDialogue method and to set "Time.timeScale = 1" in the EndDialogue method.
@nathannlatimore7863
@nathannlatimore7863 2 жыл бұрын
Thank you so much!
@syamz
@syamz 2 жыл бұрын
Thank you so much for the typing speed!
@winnerinsanjaya7604
@winnerinsanjaya7604 Жыл бұрын
ahhh nicee
@winnerinsanjaya7604
@winnerinsanjaya7604 Жыл бұрын
so i can use this without timescale?
@Blinkers2007GameDev
@Blinkers2007GameDev Жыл бұрын
Thanks!
@nabeast1980
@nabeast1980 6 жыл бұрын
It's funny because my friend and I were going to make a 2D game for a high school project and literally talked about how we should make a dialogue system. Always one step ahead of us Brackey!
@dangerranger4780
@dangerranger4780 6 жыл бұрын
NaBEAST I also planned about it yesterday
@zokaper801
@zokaper801 4 жыл бұрын
you forgot the S
@Blinkers2007GameDev
@Blinkers2007GameDev Жыл бұрын
lol
@TheLunarElixir
@TheLunarElixir 4 жыл бұрын
This is so clear and so helpful! Your tutorials are perfect, you go at just the right speed, you never ramble, and you make a program that seems complicated and daunting feel easy to learn! Thank you for all your hard work!
@reversible8740
@reversible8740 6 жыл бұрын
As soon as another BRACKEYS video comes out... GOTTA GO FAST
@mel0dyy_
@mel0dyy_ 6 жыл бұрын
GOTTA CODE FAST!
@RexArtTv
@RexArtTv 6 жыл бұрын
Reversible Nice video! Do you have a beginner video about Unity?
@reversible8740
@reversible8740 6 жыл бұрын
Rex Art Im sorry but i dont have a channel developed yet. You might wanna checkout brackeys begginer videos.
@aldehuyatid5846
@aldehuyatid5846 4 жыл бұрын
Hmmmm you’re not first though You’re too slow!
@reversible8740
@reversible8740 4 жыл бұрын
Alde Huyatid lol 2 years later kinda crazy. This was all before brackeys blew up
@IndieMarkus
@IndieMarkus 6 жыл бұрын
I love the visuals and idea with the queue system! However, when you have a game with a lot of dialogue (eg. an RPG), you should rather use external text files for storing conversations. XML or Json - for example - could be used there. This enables you to write dialogues in a more lightweight environment (notepad++), is more expandable and - most importantly - makes your game easily translatable later on.
@IndieMarkus
@IndieMarkus 6 жыл бұрын
Hmm, I don't really know, since I didn't learn it from KZbin, but in University. First of all you should learn how XML is structured syntactically. It's not really that hard - especially when you know how html works (which is based on xml). In Unity you can import xml files as assets of type "TextAsset". This is how you can load a file in Unity answers.unity3d.com/answers/63443/view.html Within the c# script you can then use XmlDocument to parse your xml file(s). This short stackoverflow answer gives you an idea on how this could look like: stackoverflow.com/a/55840/6330074
@waterandtreefilms
@waterandtreefilms 6 жыл бұрын
Very good Point.
@ayli765
@ayli765 4 жыл бұрын
OR, if you are not very good at this, like me, you could just leave the name fields blank, and put the name of the character speaking at the beginning of each text block.
@anirudhganesh7714
@anirudhganesh7714 3 жыл бұрын
@@IndieMarkus For games that have extensive conversations, this method would work really good. Although I'm here just for making a prototype and this is more than enough for me. So I think this is a good starting point for beginners and this itself might be too complicated for some people.
@stickguy9109
@stickguy9109 2 жыл бұрын
I am a bit late for this reply but I am wondering if you can make some kind of a basic programming language for that. You write your code in a .txt file and c# reads and compiles that. Something like: Say "Hello I am NPC";
@GaryParkin
@GaryParkin 4 жыл бұрын
Thank you Brackeys, you make things stupid simple. Programming in Unity is really cool. I need to watch this a few times and do it, save it and make notes everywhere. The way you can reference objects in classes and other classes is insane. It gives me a whole new appreciation for the OOP I use in work.
@riseoftech4k332
@riseoftech4k332 6 жыл бұрын
always making a useful video when I need it .. perfect timing thanks
@RKD1010
@RKD1010 6 жыл бұрын
rip linda
@cheongja4617
@cheongja4617 3 жыл бұрын
69 likes f
@moonsliced
@moonsliced 3 жыл бұрын
F
@goran.gamedev7759
@goran.gamedev7759 3 жыл бұрын
F
@VoidboiX
@VoidboiX 2 жыл бұрын
Who's Linda?
@SKGaming-gs4ul
@SKGaming-gs4ul 5 жыл бұрын
This was great Brackeys! And I love how it's so easy to add your own custom features onto it. I made it so that you can't skip the text until it's finished animating :).
@Hypericus82
@Hypericus82 5 жыл бұрын
SK Gaming that drives me mad in games!!
@madlad255
@madlad255 3 жыл бұрын
It depends on what you're doing, but I'd recommend making it so that pressing 'Continue' when the text is still going will make it automatically put the whole thing in. I haven't tried this, but it doesn't look too hard to implement.
@TheCrustiCroc
@TheCrustiCroc 6 жыл бұрын
This is by far the best tutorial ever made for Dialogue boxes.
@Blind56
@Blind56 6 жыл бұрын
wish you'd have posted this video way back when i was developing my first few games. i learned the hard way :)
@krystian9186
@krystian9186 6 жыл бұрын
Please make a extended dialogue system tutorial where you can select what to answer to.
@scottreilly7310
@scottreilly7310 6 жыл бұрын
Mythis I guess for example you would just add two button responses that only appear when a certain sentence is loaded. Then based on what button you press call a function, which loads the specific sentence to the answer you chose
@davidkim4653
@davidkim4653 6 жыл бұрын
Have you done this before? I'm having trouble implementing something similar
@kuryart4586
@kuryart4586 6 жыл бұрын
David Kim, what's your trouble?
@twoboxtoofurious
@twoboxtoofurious 5 жыл бұрын
This guy made one and made it open source. Great guy. It can be a little bit advanced, he uses costum editor scripts. github.com/7ark/Simple-Dialogues
@thiskidcalledtom
@thiskidcalledtom 5 жыл бұрын
Check out Fungus
@johnphilipangeles1825
@johnphilipangeles1825 5 жыл бұрын
Love these tutorials, simple, straight to the point with important details, good quality and no bs.
@TailedCarpet
@TailedCarpet 5 жыл бұрын
Would be pretty cool to see how to make the system where two charecters could have a conversation, so you would need to change the character name depending on which one is talking
@TheLoveMiku
@TheLoveMiku 3 жыл бұрын
i want to know that too...
@jangou4763
@jangou4763 3 жыл бұрын
Please I have been searching how to do this for days anyone got an idea ?
@jangou4763
@jangou4763 3 жыл бұрын
Found out btw it's really simple, you just have to make the name an array. So basically do exactly the same with the name and with the text.
@bartbartbartbartbartbart
@bartbartbartbartbartbart 3 жыл бұрын
I was thinking way to complicated thanks omg
@rezazolgharnein7609
@rezazolgharnein7609 2 жыл бұрын
​@@jangou4763 Hi, can you put a piece of code for example?
@tommyyodergamecreator
@tommyyodergamecreator 3 жыл бұрын
For all who want the button that displays the next text to be interactable after the text finishes here is the code. I just stumbled on this while working on some game updates. IEnumerator TypeSentence(string sentence) { storyText.text = ""; foreach(char letter in sentence.ToCharArray()) { storyText.text += letter; yield return null; } skipButton.interactable = true; } I hope this helps you out! :)
@tommyyodergamecreator
@tommyyodergamecreator 3 жыл бұрын
If you are using a controller. public void DisplayNextSentence() { if(sentences.Count == 0) { EndStory(); return; } skipButton.interactable = false; string sentence = sentences.Dequeue(); StopAllCoroutines(); StartCoroutine(TypeSentence(sentence)); } IEnumerator TypeSentence(string sentence) { storyText.text = ""; foreach(char letter in sentence.ToCharArray()) { storyText.text += letter; yield return null; } GameObject.Find("EventSystem").GetComponent().SetSelectedGameObject(firstObject, null); skipButton.interactable = true; }
@irarelyupload6930
@irarelyupload6930 9 ай бұрын
Very nice, this helped me so thanks. Instead of the skip button, I used a bool called "isTalking" because my dialogue is interacted through pressing the "E" key. I also made it so you could speed up the text after pressing continue twice, and the boolean makes it so you still can't skip until the text is finished. public void DisplayNextSentence() { if (sentences.Count == 0) { EndDialogue(); return; } typeSpeed = 0.02f; isTalking = true; string sentence = sentences.Dequeue(); StopAllCoroutines(); StartCoroutine(TypeSentence(sentence)); } IEnumerator TypeSentence(string sentence) { dialogueText.text = ""; foreach (char letter in sentence.ToCharArray()) { dialogueText.text += letter; yield return new WaitForSeconds(typeSpeed); } isTalking = false; } void Update() { if (Input.GetKeyDown("e")) { typeSpeed = 0f; if (!isTalking) { DisplayNextSentence(); } } }
@scut_it_out
@scut_it_out 3 жыл бұрын
For those who want it to call DialogueTrigger when startup Write "Awake" instead of TriggerDialogue If you want to cause a delay between it, then use the Invoke command (look it up for even more detailed explanation)
@mdkcynic
@mdkcynic 3 жыл бұрын
You should also mention that Awake is called before Start -- so if you are following this tutorial remember anything in Start will not be called before Awake and you will run into null reference errors.
@Tubcio
@Tubcio Жыл бұрын
@@mdkcynic How to fix it? It doesn't work - null error
@mdkcynic
@mdkcynic Жыл бұрын
@@Tubciosend me an email address, I can take a look at the code for you
@Tubcio
@Tubcio Жыл бұрын
@@mdkcynic you don't have to, I already fixed this :D
@loisky8561
@loisky8561 Жыл бұрын
@@Tubcio How did you fix it?
@SuperRalle123
@SuperRalle123 6 жыл бұрын
This is really high quality content. I have to say that I have never seen so well made tutorial videos before. Thank you a lot, and keep up the amazing work!
@imconfused6955
@imconfused6955 5 жыл бұрын
This is an old video, but man is this script well planed! Just messing around with it has shown me how easy it is to call it, and the wide variety of ways to do so. Thanks for making such a well planned and accessible script.
@alejandronebot300
@alejandronebot300 2 жыл бұрын
I'm having a problem with the FindObjectOfType function bc it returns this message when I click on the button: Object reference not set to an instance of an object
@MoonKnight11
@MoonKnight11 6 жыл бұрын
Thanks for making this awesome video! perfect timing!
@BobbyMcwho
@BobbyMcwho 6 жыл бұрын
Just wanted to say, thank you for all the tutorials, I have learned something new in pretty much every video I have watched of yours so far, and I love that you are direct, straight to the point, and don't have a bunch of downtime or uhmmms like some creators.
@198boblob
@198boblob 5 жыл бұрын
I’ve been using Unity for a long time but these tutorials are so good I’m just watching them for fun at this point. Great videos
@Dezomm
@Dezomm 4 жыл бұрын
If you are getting problems with null reference exceptions with your "sentences" variable, (error should first appear on sentences.Clear() if you are following Brackeys exactly) probably its because you are calling StartDialogue() before Start() is called at all (which is where the sentences variable is initialized). HOW TO FIX: You can fix this by changing Start() to Awake() in your DialogueManager.cs script. Awake() is called BEFORE ANYTHING ELSE in the script., while Start() is only guaranteed to be called before the first frame, which can cause some hard to find errors...
@joaovictorcamposmachado3753
@joaovictorcamposmachado3753 9 ай бұрын
thank you man, i had this problem and you saved me. God bless you
@srmarcosx
@srmarcosx 6 жыл бұрын
Starring Dwayne "The Rock "Johnson
@Totatix83
@Totatix83 6 жыл бұрын
Perfect timing, I have a dialogue system to implement in the game I'm working on atm, thx Brackeys for the great video
@carlosdalomba8455
@carlosdalomba8455 6 жыл бұрын
Thank you so much Brackeys! For some reason, implementing a dialogue system has had me stumped for a while, but you just breezed through it! I learned a ton from this video :)
@toreole2993
@toreole2993 6 жыл бұрын
You should rename your channel to "Best and most useful unity tutorials" ... Its too long, how about "Unity Tutorial King"
@timsmith3346
@timsmith3346 6 жыл бұрын
There is one word for that. And that word is Brackeys.
@trafkgaming7604
@trafkgaming7604 5 жыл бұрын
+1
@PZMaTTy
@PZMaTTy 4 жыл бұрын
Yes man, all of their tutorials are awesome, very wll explained
@beri4138
@beri4138 3 жыл бұрын
Unity Pog
@Charditronic
@Charditronic 5 жыл бұрын
That's great! But if you need diferent characters talking... I supose that we need to do transform the variable "Dialogue" (from DialogueTrigger script) in a Array (like this "Dialogue [ ]" ). But... How can we do for Start the next Dialogue? I supose we must create a function in DialogueManager script, but I don't know what to do... :'(
@capncrunchfan255
@capncrunchfan255 2 жыл бұрын
The name is the same type of variable (string) as the dialogue text. You could try to do the same thing for the name as you did the dialogue text.
@skeleton_king
@skeleton_king 4 жыл бұрын
2 years old and still perfect. Good work!
@sgyffysgyffy4736
@sgyffysgyffy4736 6 жыл бұрын
Thanks Brackeys! Would love to see a follow up video expanding the dialogue system! Ideas like, reading the conversations in from JSON, dialogue trees, etc.
@t3chnohippi3
@t3chnohippi3 6 жыл бұрын
Don't care about who complains you're too fast, your pace is perfect. We got video settings and a pause key for something. Thanks to you i can learn so many things saving a lot of time and that's amazing.
@SepiaDragoonGR
@SepiaDragoonGR 6 жыл бұрын
I find that i cannot use this for multiple NPC. Even if i add names and dialogs to each and every one of them, every one that i speak too will only have the name and dialog that was the shortest string. Any help?
@oliverblomfield4932
@oliverblomfield4932 6 жыл бұрын
Your tutorials are the best Brackeys. Really appreciate all the hard work you put in.
@ToniPlays_
@ToniPlays_ 6 жыл бұрын
Love your tutorials. Simple and easy to understand. Keep it up bro!!
@mumenraida1023
@mumenraida1023 2 жыл бұрын
How would i implement this in a scenario where two characters are having a conversation via text boxes? What i mean, how would i alternate one active textbox with the other? Thank you kindly!
@Enderia2
@Enderia2 4 ай бұрын
Likely just have the continue button in that scenario activate another script instead of continuing the current dialogue box. Alternatively, you could forgo the name box and put it in yourself.
@adibmukhlis5256
@adibmukhlis5256 6 жыл бұрын
but...what if I want to make the player can interact with the continue button (showNextSentence) by pressing space key
@lucky-two
@lucky-two 6 жыл бұрын
I Honestly love your videos Brackeys! so easy to follow, and your instructions ALWAYS works for me!
@lethn2929
@lethn2929 6 жыл бұрын
Really liking your most recent videos Brackeys, they're always up to date and in C#, you might not think that's a big deal but considering how annoying it is finding up to date tutorials this kind of thing really makes a difference
@corrondo8983
@corrondo8983 Жыл бұрын
For whoever is experiencing the text repeating what's left of the line of the dialogue in progress, into the next window of dialogue, put a "StopAllCoroutines()" in where it registers the player input for progressing the dialogue. It happened for me when I wanted to skip it too quick.
@leliba13
@leliba13 6 жыл бұрын
Great as always! maybe a choice system (with a node editor) could be nice!! I was thinking something along the lines of the following structure: Dialogue:{ Character {Name, picture, tone} Text Choices[{name, () => enabled? , Dialogue, () => effect}] } If Choices is null or empty, then it means it's the end of conversation. If there is only one choice, then it works similar to the list you use in your system. enabled -> boolean function meant to check conditions by which you can access this part of conversation (quest completed? enough lv? etc) effect -> void function which makes it possible for the Dialogue choice to affect the game world (for example () => character.evil++) picture -> for example, face of the talking character. tone -> could be an enum, which sets the style of the text
@MsCoffeeFellow
@MsCoffeeFellow 6 жыл бұрын
Brackeys, your tutorials are so easy and informative, super interesting to follow. thanks!
@boombaby1769
@boombaby1769 6 жыл бұрын
I simply love your coding style. Learned a LOT in this one!
@adeadchannel4129
@adeadchannel4129 6 жыл бұрын
Are you ever thinking about a tutorial (i know this is a big idea) but making a game then uploading it to steam then showing us how to update the game once its published to add new stuff.?
@nikolafilic1215
@nikolafilic1215 6 жыл бұрын
To upload a game on steam you need to pay 90$. Sure, he can do it but it's expensive as hell, and not that hard even.. Instead he can show how to Itch.io or something else
@adeadchannel4129
@adeadchannel4129 6 жыл бұрын
Does steam cost $90 A month?
@deepbluezen4751
@deepbluezen4751 6 жыл бұрын
It's a $100 per submission
@doggo4616
@doggo4616 6 жыл бұрын
nope, just pay the fee and you are good
@nikolafilic1215
@nikolafilic1215 6 жыл бұрын
And i believe they take about 25% of your earnings, or maybe not
@alberquepasa
@alberquepasa 4 жыл бұрын
it would be easier to understand if don´t name everything "dialogue"
@ernestoasustao
@ernestoasustao 4 жыл бұрын
Diselo hermano
@typharian9281
@typharian9281 3 жыл бұрын
Using dialogue to make a dialogue game to dialogue with dialoging NPCs and have fun dialogue......dialogue
@AlexanderZotov
@AlexanderZotov 3 жыл бұрын
@@typharian9281 Did you mean dialogue?
@donutgoose2336
@donutgoose2336 3 жыл бұрын
Thanks! I cannot even tell how much his tutorials helped me.
@Yugenki
@Yugenki 6 жыл бұрын
Really thanks for the dialogue system you showed, did my own adapted for my game using great tips from here
@blavatskyvertite4361
@blavatskyvertite4361 3 жыл бұрын
For anyone getting null reference error in sentences.Clear(); because you are calling automatically from a void start(), u could make a Invoke("mymethod", 0.5); where mymethod would be the startDialogue(dialog); and "0.5" seconds to before trigger it. it works for me because i want the dialog start almost before loading the scene.
@AkaGiant1
@AkaGiant1 4 жыл бұрын
If you want the text to appear faster/slower you can do something like this (it could be crap but it works) IEnumerator TypeSentence (string sentence) { DialogueText.text = ""; foreach (char letter in sentence.ToCharArray()) { DialogueText.text += letter; for (int i = 0; i < 10; i++) // Change "10" to change the speed of the writing { yield return null; } } }
@irarelyupload6930
@irarelyupload6930 9 ай бұрын
It works. Cheers mate.
@Ken-nm6ve
@Ken-nm6ve 6 жыл бұрын
holly sht, the best tutorials ive ever watched! its just so much detailed while the whole video is short! Thanks mate!
@incpwnge
@incpwnge 5 жыл бұрын
This was not particulary what i was searching for, but i couldn't stop myself watching it through..
@benrt1158
@benrt1158 4 жыл бұрын
Can someone please help me! Every time my player goes to a new scene the dialogue continue button stops working! can someone please tell me how to fix this?! Edit: I found out how to fix it, you need the EventSystem also in the new scene!
@reed9269
@reed9269 6 жыл бұрын
maybe i overlooked, but this is not dialogue its monologue
@neotomatoe7257
@neotomatoe7257 4 жыл бұрын
no u wrong
@xenno100
@xenno100 3 жыл бұрын
@@neotomatoe7257 mono refers to one, so anytime only 1 person speaks for the entire encounter, that is a monologue by definition. but what i think Reed is trying to say (or maybe not but i definitely am) is that this could certainly use an explanation on how to add replying to the system. like a simple "yes / no" button that only shows up at certain sentences.
@kristianthaler6525
@kristianthaler6525 Жыл бұрын
Professional looking conversations for any game in 16 minutes, minus the intro and outro... I am astounded.
@anirudhganesh7714
@anirudhganesh7714 3 жыл бұрын
Thanks a lot brackeys. Surely will miss ya. This basic setup helped me with random dialog boxes somehow.
@maggie2880
@maggie2880 5 жыл бұрын
im having trouble making the system work. My script is skipping right to the "End Conversation"
@Brick69
@Brick69 3 жыл бұрын
Yea me too
@blackflashcosplay2720
@blackflashcosplay2720 6 жыл бұрын
Is there a way I can make the dialogue start without the start button? I need my dialogue to start once the scene loads. I've tried calling it in the start function but it gives me errors.
@infinitesauce8206
@infinitesauce8206 6 жыл бұрын
me too ;-;
@emersonmanuba8273
@emersonmanuba8273 6 жыл бұрын
please can u find one that don't need a start button. I mean if you find a dialogue that start immediately. PLEASE PLEASE! Thank you very much
@emersonmanuba8273
@emersonmanuba8273 6 жыл бұрын
an Nice one! Thank you very much for giving us knowledge..! Keep it up.!
@sgggongo5756
@sgggongo5756 6 жыл бұрын
an you are a god
@GizmoDude01
@GizmoDude01 5 жыл бұрын
an Ok i have no character or box colliders in my game how can i make it run on start ive tried everything i can think of but im getting no where plz help this is so simple that i cant figure it out and is driving me nuts (Also great video i love the divide and conquer method)
@joshuamcmillan6919
@joshuamcmillan6919 6 жыл бұрын
Thanks for making these scripts available! Thankfully, I know how to make changes to suit my project. I didn't know about making custom classes (non-Monobehavior) and the Queue.
@frodox10
@frodox10 Жыл бұрын
Wish these guys were still around, great tutorial.
@tobycook9039
@tobycook9039 6 жыл бұрын
how do I add multiple of these at once? n my game I have multiple npc's and when you run into them, your character stop and it activates the text box. each NPC has a dialogue trigger with their own names and text. but because have multiple of these on one scene, whenever i speak to an npc they all say the same text from one dialogue trigger and i dont know how to fix it plz help.
@tobycook9039
@tobycook9039 6 жыл бұрын
Nvm i fixed it, i was using FindObjectOfType to find the trigger now i’m using collision.gameObject.GetComponent and it works, also you can but sounds in the foreach statement and i makes a sound every time they talk and also the speed they talk, i controll this using strings
@mvtiasmat
@mvtiasmat 6 жыл бұрын
How can you change the speed at which they talk? I mean the speed each individual character shows on screen. I tried using WaitForSeconds instead of yield return null but it's too slow.
@kittenish7116
@kittenish7116 5 жыл бұрын
use wait for secnods but have iit low like 0.02 (i used thaat) Edit: Oh god my grammar holy crap... D;
@Firestar-rm8df
@Firestar-rm8df 5 жыл бұрын
@@kittenish7116 wait for seconds is a bit janky imo. You want to create a character buffer in the coroutine that uses delta time to add a certain number of characters since the last frame, and use floats, not ints to count characters and add the partial character overflow to the number of characters to print out next frame each time, so the remainder keeps rolling over to the next print creating smoother printing.
@sanjuanabigail
@sanjuanabigail 5 жыл бұрын
Please help! :) How do you trigger a dialogue right when the player enters the scene? Like I don't need a button to start the conversation with the NPC.
@CasualCosta
@CasualCosta 4 жыл бұрын
Call TriggerDialogue on Start or Awake.
@SaadTahirVelocity7
@SaadTahirVelocity7 6 жыл бұрын
Man your tutorials are simply amazing. I just ended up watching ten of your tutorials and learnt a lot. I wanted to make a dialog system between two person but I couldn't understand your method. So I just changed the Dialogue class having a single name and sentence string elements. Then I made an array of dialogues in Dialogue Trigger class. Then I called those sentences and names one by one. And WALAH! I was able to show those dialogues with different names and sentences. However I don't understand the way you told in here. Thanks!
@JMacify
@JMacify 6 жыл бұрын
Awesome video! I always enjoy your videos and the explanations you give for everything. Dont listen to the few people who provide nothing and just hate on everything others give out.
@EnjiRouz
@EnjiRouz 6 жыл бұрын
How to make dialog between two or more characters using this system ?
@mirageowl
@mirageowl 6 жыл бұрын
I'm not an expert but here is a quick idea: Expand the Dialogue class with 2 more variables: bool hasFollowup, Dialogue followupDialogue Then go to DialogueManager script and find DisplayNextSentence() method. Inside the if(...) replace EndDialogue and have a code like this: if(dialogue.hasFollowup) { StartDialogue(dialogue.followupDialogue); } else { EndDialogue(); }
@mirageowl
@mirageowl 6 жыл бұрын
I was thinking a way to edit followupDialogue, so I came up with this: you can add followupDialogue variable to DialogueTrigger and edit it there and pass it to the dialogue object before callinng StartDialogue on it. This was more messy than I though so probably something else can be done.
@EnjiRouz
@EnjiRouz 6 жыл бұрын
MirageOwl Actually I've found the best way to do it Just make dialogs array in the trigger And make queue of dialogs in manager, not phrases Fix some errors And that should do it :) You should make Dialog class like class with one phrase (not array) and one name
@mirageowl
@mirageowl 6 жыл бұрын
That makes sense, thanks!
@ernestlaurentorres8164
@ernestlaurentorres8164 5 жыл бұрын
@@EnjiRouz what do you mean by not phrases?
@banacatrulez
@banacatrulez 4 жыл бұрын
is there any way i can make it so that instead of clicking the button I can press a certain key?
@goatishboyvantwinkletoesga2151
@goatishboyvantwinkletoesga2151 4 жыл бұрын
carl wheezer Input.GetKeyDown()
@tobihudiat
@tobihudiat 3 жыл бұрын
@@goatishboyvantwinkletoesga2151 yeah and then connect it with a collider that is triggered if you want to press for example enter in front of a person
@bigjiggly7490
@bigjiggly7490 6 жыл бұрын
Everytime I see a new Brackeys video, I always watch it. No matter what I'm doing and no matter what they upload, I'm like Sonic on steds when I see a new video.
@bchaner725
@bchaner725 4 жыл бұрын
Thank you, I've learned so much watching your videos.
@Kirzolitro
@Kirzolitro 6 жыл бұрын
If you wanna avoid line-jumping when a word doesn't fit, check this: answers.unity3d.com/questions/1385298/ui-text-words-at-end-of-line-jumping-to-next-line.html
@viktorleon7915
@viktorleon7915 4 жыл бұрын
Thank you! *I had a little issue while using textmeshpro, I could'nt use it in the public variable on the inspector at the Dialogue manager. I turned it into regular text and the issue was solved. I'd like to know is there is a way to use TMP though! Thanks again! It works great!
@anoncoms
@anoncoms 4 жыл бұрын
I have the same question, would love an answer!
@RodolpheJL
@RodolpheJL 4 жыл бұрын
you have to tell you're using tmp so insert this at the beginning of your code : using TMPro; Then you have to use TextMeshProUGUI for the texts you use : public TextMeshProUGUI nameText; public TextMeshProUGUI dialogueText;
@elllieeeeeeeeeeeeeeeeeeeeeeeee
@elllieeeeeeeeeeeeeeeeeeeeeeeee 4 жыл бұрын
(top of file) using TMPro; Instead of "Text" use class "TextMeshProUGUI" or "TMP_Text"
@SuperMinecraft567
@SuperMinecraft567 4 жыл бұрын
Thx guys i had the same problem
@MilySotelo
@MilySotelo 6 жыл бұрын
It is helping me a lot to finish my thesis, thank you so much ♥
@kreuzbube99
@kreuzbube99 6 жыл бұрын
I just wanted to thank you for your extremely helpful videos! Keep it up
@iStory852
@iStory852 6 жыл бұрын
very usefull
@chronotorii5353
@chronotorii5353 5 жыл бұрын
Hey Brackeys! I know it's been more than a year since you uploaded this video but can you please make a video of a dialogue system without the start conversation and the player can choose their own answer?
@TheSpacecraftX
@TheSpacecraftX 6 жыл бұрын
Singleton is such a useful design patter in unity for gong between scenes.
@Jono6321_true
@Jono6321_true 6 жыл бұрын
I always thought it was really difficult to make a dialogue system. Brackeys has proved me wrong once again.
@quickfixian
@quickfixian 6 жыл бұрын
What if I want to make the dialogue run in the beginning of a scene and then instead of a continue button you use an input? Sitting here trying to program a game for school and can't seem to find anything closer to what I'm looking for than this video
@nicospadoni5328
@nicospadoni5328 4 жыл бұрын
I know this is a very old comment, but for those that need it, I created a system that starts the dialogue by pressing "e" whenever you're close to the character in question. It has however a bug when talking to multiple characters that use the same trigger script, so you should use different ones. Put this inside TriggerDialogue: private bool firstTime == false; void OnTriggerStay(Collider other) { if (other.tag == "Player"){ if(Input.GetKeyDown(KeyCode.E) && firstTime == false){ FindObjectOfType().StartDialogue(dialogue); firstTime = true; if (Input.GetKeyDown(KeyCode.E) && firstTime == true FindObjectOfType().DisplayNextSentence(); } } } EDIT: The player must have a second, bigger collider set as "trigger" and must be tagged appropriately.
@jacobyork2961
@jacobyork2961 2 жыл бұрын
@@nicospadoni5328 hope this works was trying to figure out ow to do this same thing
@jacobyork2961
@jacobyork2961 2 жыл бұрын
@@nicospadoni5328 didn't work :(
@nicospadoni5328
@nicospadoni5328 2 жыл бұрын
@@jacobyork2961 What happened? It's been a while since I used this code but let me know what you did and if you got any errors
@vr_bandit2429
@vr_bandit2429 2 жыл бұрын
I tried this but nothing seemed to happen, it didnt send signals nor did it change the dialogue
@GameDevJosh
@GameDevJosh 6 жыл бұрын
How do you get rid of the "Start Conversation" button after the dialogue button has begun?
@GameDevJosh
@GameDevJosh 6 жыл бұрын
Never mind I solved it. I might have done it a bad way but I called the button in a FindObjectOfType().SetActive(false); inside of the void TriggerDialogue(){} . Hey if it works it works. If anyone knows of a better solution please comment
@jackunlocker3125
@jackunlocker3125 6 жыл бұрын
Better way is: Not "FindObjectOfType" but make "public Button startButton" in your TriggerDialogue and drag that button into that slot in the editor. So it will be just "startButton..SetActive(false);" Good luck ;)
@rimoros.1020
@rimoros.1020 6 жыл бұрын
instead of a public button, make it a GameObject instead, only using the button only disables the button script
@teapottanuki5841
@teapottanuki5841 5 жыл бұрын
I actually understood this which is no small feat. Awesome vid!
@jaybabel3528
@jaybabel3528 5 жыл бұрын
You're so awesome :D Thank you so much for all the hard work and effort that you put into helping folks understand how everything works. Your work is essential and inspiring in my own journey into game-making and I just want to let you know how awesome you are! Have a great day and even greater adventures!
@ardaozcan3666
@ardaozcan3666 6 жыл бұрын
I am using Textmeshpro and unity doesn't recognize it as a text (10:52) Do I have to use default text?
@solomonlyons10
@solomonlyons10 6 жыл бұрын
did you figure out the TextMeshpro thing?
@ardaozcan3666
@ardaozcan3666 6 жыл бұрын
Nope :(
@BajatuRoman
@BajatuRoman 6 жыл бұрын
You need to add "using TMPro;" and declare the text as "public TextMeshPro", then it's the same.
@solomonlyons10
@solomonlyons10 6 жыл бұрын
aaayyy Bajatu ftw. thx dude
@williamvarney2300
@williamvarney2300 6 жыл бұрын
its in the TextMeshPro documentation under scripting. I know he gave you the answer already, but the first place to check for these things is the documentation. Also, on a side note depending what version you are using it might be declared as "public TMP_Text yourTextName"
@charlesbarnes3249
@charlesbarnes3249 6 жыл бұрын
Thanks, great video! I highly appreciate if someone could lend their expertise and answer my questions below: ) 1. How would I go about making this a dialogue system and not a monologue? 2. I'm making a FPS and will not use OnClick, how can I change this input continue/change the dialogue box with the spacebar? thank you, thank you!
@Sonsho
@Sonsho 5 жыл бұрын
Hello have you managed to do it? I wanna do the same thing
@TripleZetta
@TripleZetta 3 жыл бұрын
Hello have you managed to do it? I wanna do the same thing
@colorfury6936
@colorfury6936 2 жыл бұрын
@@TripleZetta ...
@panupentikainen953
@panupentikainen953 6 жыл бұрын
Superb tutorial, so useful! You are one of the best tutorial makers on KZbin. :)
@GiovanniConcer
@GiovanniConcer 6 жыл бұрын
And yet again, I'll have to stop studying to go back to Unity xD Love your videos, keep up the awesome work. Greetings from Brazil!!
@legitchrisv
@legitchrisv 6 жыл бұрын
How can I load the Dialogue System as soon as the scene loads?
@CleosetricVlyers
@CleosetricVlyers 5 жыл бұрын
do you have solved that? i have same problem too
@nicospadoni5328
@nicospadoni5328 4 жыл бұрын
You can call the trigger function on "Start", and the continue ones on a different function(such as update, or OnTriggerStay).
@yueheiyeung3643
@yueheiyeung3643 5 жыл бұрын
nullReferenceException: object reference not set to an instance of an object DialogueManager.StartDialogue(Dialogue dialogue) (at Asset/DialogueManager.cs:19) can anyone help?
@exinr6930
@exinr6930 5 жыл бұрын
i'm having a similar issue i have no clue what I'm doing wrong.
@BedWords_
@BedWords_ 4 жыл бұрын
@@exinr6930 I think this happens when you forget to drag your Text objects over to the appropriate slot in the DialogManager component section in the Editor. In other words, it's not pointing to a specific Text object.
@kartikshah370
@kartikshah370 6 жыл бұрын
Some smart way of code! Brackeys you are doing great!
@ChrisWarner_1
@ChrisWarner_1 6 жыл бұрын
I've been thinking of adding this to my game I'm making. Thank you so much, now I know how to
@Prihatmafaza
@Prihatmafaza 6 жыл бұрын
How to change the Trigger ? , i mean i dont need a button to Start the dialogue, i want when i open the Scene that dialoguebox is automatically appear in scene ? Sorry for my bad English , Thanks Before
@silvestrequeiruga8122
@silvestrequeiruga8122 6 жыл бұрын
Just dispatch the Method StartConversation wherever you want. For example if you need to start the dialogue when the player enters in a room ypu can set a collider at the entrande and create a Method void OnTriggerEnter (Collider other) { if(other == player) //set a layer or tag for this { DialogueManger.StartConversatio(); } }
@silvestrequeiruga8122
@silvestrequeiruga8122 6 жыл бұрын
Check the following: - You set the tag of the player as "Player"? - Make sure you add the DialogueManager script to a object in the scene. - Make sure you add the DialogueTrigger to the object that contains the boxcollider2D. - Make sure that the boxcollider2D is marked as isTrigger and the player have a rigidBody2d. (sorry for the bad english).
@silvestrequeiruga8122
@silvestrequeiruga8122 6 жыл бұрын
Great!. To find a audiosource you need to have the script added to the same object that have the audio source. In the script write: public AudioSource audio; Then in the Start method use: void Start() { audio = GetComponent(); } If you have 2 audiosource in the same object you need to asing them manually in the inspector. Make 2 public variables of type AudioSource in your script, add the script to the object with the audiosources and drag and drop them.
@silvestrequeiruga8122
@silvestrequeiruga8122 6 жыл бұрын
In that case you need to asing it manually in the inspector or use the following: var AudioSource audio; void Start { audio = FindObjectWithTag(``Theobjectwithaudiosourcetag´´).GetComponent(); }
@silvestrequeiruga8122
@silvestrequeiruga8122 6 жыл бұрын
Mmm.. in that case the only way i know if assing it manually in the inspector. Dont know any way made trough code.
@klydefortunato9580
@klydefortunato9580 6 жыл бұрын
I have a question, how can I call the next dialogue? I have 2 NPCs :| please help
@solomonlyons10
@solomonlyons10 6 жыл бұрын
I also wonder how to do this. Did you find a way?
@Chris256
@Chris256 6 жыл бұрын
i am trying to find a way as well
@alexanderfrye2688
@alexanderfrye2688 6 жыл бұрын
I know this is old but what I do (though it's probably very inefficient) is turn the name into a queue as well and just update it every time the "DisplayNextLine" function is called. (Just without typing it) Then you can jest set the name queue to be the same length as the Lines queue and change the name every time the character speaking changes in the dialogue. Hope this helps (If you even still needed it) =)
@TheLoveMiku
@TheLoveMiku 3 жыл бұрын
@@alexanderfrye2688 Hey, could you please show me the Code on how to do this. I am a beginner and would be very thankful about it. Thank you either way^^
@nubcake14
@nubcake14 2 жыл бұрын
@@alexanderfrye2688 helped my alot, thank you :)
@thegringlemingler276
@thegringlemingler276 6 жыл бұрын
Love these types of tutorials. wouldn't mind seeing a tutorial for a swimming system in the future if possible (all the other tutorials don't seem to be too well explained and lowish quality)
@chrisma2169
@chrisma2169 6 жыл бұрын
This thing is legit. Wanted a dialogue system for a long time.
@Andromeda9009
@Andromeda9009 6 жыл бұрын
This is a monologue system..
@josephromines6057
@josephromines6057 4 жыл бұрын
Here's the thing - he shows you how to do it. He also says a system that you can easily tweak to suit your game. So you should tweak it to make it talk between you and NPC's if that is what you want. Otherwise, take it as is or find a different tut, he can't make your game for you :)
@mihajlonesic
@mihajlonesic 5 жыл бұрын
Make a "multi-person" dialogue system
@CasualCosta
@CasualCosta 4 жыл бұрын
In case anyone is still looking, I made an adaptation to the script so it fits two or more people in the conversation: repl.it/@Felipe_ThiagoTh/BrackeysDialogueUpdate
@cosminblaga6419
@cosminblaga6419 4 жыл бұрын
@@CasualCosta I see yours and raise you one: repl.it/repls/KnowingLawfulGravity (I'm too lazy to create an account so I just left an anonymous repl). I tried to keep the initial classes as designed, keep the original Dialogue class but modified, use DialogueTrigger for the conversations, and access it from DialogueManager.
@useless3310
@useless3310 4 жыл бұрын
@@cosminblaga6419 hi, i'm using your script and it's been working great so far but after reloading the project i keep getting the error "IndexOutOfRangeException: Index was outside the bounds of the array." even though i didn't change anything about the script. do you have any idea what that's about?
@zixindeng5626
@zixindeng5626 4 жыл бұрын
Wow,amazing!!!But I have a question:this is not a questions and answers mode,right?Does it only change another name when the last one has finishet his dialogues?
@cosminblaga6419
@cosminblaga6419 4 жыл бұрын
​@@useless3310 It's not only the script, somehow the object in Unity is connected to the script. They work in unison. To see exactly where the problem is, try to debug it. Print a message with your conversations size ( Debug.Log("conversations size: " + conversations.Length) ) and at every step and see where things go wrong. I've changed the dialogue a lot since I started. I'm using ScriptableObject(s) now. The error suggests you are trying to access an element in the array although it doesn't have the size of the requested index. Something like: conversations has length 3 and you try to get conversations[3] (the three elements being at indexes 0,1 and 2).
@rigzmoviediaries654
@rigzmoviediaries654 5 жыл бұрын
Thanks to you I am currently 25% ready to start my game as a gamedev
@winoramadhan9692
@winoramadhan9692 6 жыл бұрын
This is really helpful for me, thanks dude!
How to make a Dialogue System with Choices in Unity2D | Unity + Ink tutorial
29:45
Shaped by Rain Studios
Рет қаралды 133 М.
5 Minute DIALOGUE SYSTEM in UNITY Tutorial
5:11
BMo
Рет қаралды 148 М.
Шокирующая Речь Выпускника 😳📽️@CarrolltonTexas
00:43
Глеб Рандалайнен
Рет қаралды 11 МЛН
1❤️#thankyou #shorts
00:21
あみか部
Рет қаралды 70 МЛН
IS THIS REAL FOOD OR NOT?🤔 PIKACHU AND SONIC CONFUSE THE CAT! 😺🍫
00:41
Best Dog Videos of the Decade
13:05
Daily Dose Of Internet
Рет қаралды 2 МЛН
7 DEVS Make a GAME without COMMUNICATING!
17:18
Blackthornprod
Рет қаралды 647 М.
SAVE & LOAD SYSTEM in Unity
18:20
Brackeys
Рет қаралды 1,1 МЛН
The Future of Game Development
8:58
Brackeys
Рет қаралды 1,1 МЛН
Optimizing my Game so it Runs on a Potato
19:02
Blargis
Рет қаралды 393 М.
The Evolution of My Game's Dialogue System
43:36
AdamCYounis
Рет қаралды 43 М.
Learn Ink (video game dialogue language) in 15 minutes | Ink tutorial
14:47
Shaped by Rain Studios
Рет қаралды 56 М.
1 Year of Learning Game Development In 6 Minutes
6:01
Giedzilla
Рет қаралды 2,4 МЛН
choosing a game engine is easy, actually
15:08
samyam
Рет қаралды 263 М.
Шокирующая Речь Выпускника 😳📽️@CarrolltonTexas
00:43
Глеб Рандалайнен
Рет қаралды 11 МЛН