КОМЕНТАРІ •

  • @Cerified
    @Cerified 3 місяці тому +18

    For those who are confused as to where to put your text. When you go to the DialogueBox’s inspector, underneath the Dialogue script tab, there’s another tab called ‘Lines’. That’s where you add it! :)

  • @igseatsyursoul
    @igseatsyursoul 2 роки тому +85

    Finally a dialogue that is basic with no bells and whistles that I can fully customize. Too many of the other tutorials on this added way more than I want for my small game.

  • @LaneWatson
    @LaneWatson 3 роки тому +154

    Ahh yes. Got my 5 minute fix. The most useful tutorials on Unity.

    • @BMoDev
      @BMoDev 3 роки тому +13

      Haha thanks! Appreciate ya

    • @PlagueDoctor856
      @PlagueDoctor856 3 місяці тому

      INCORRECT! THIS VIDEO IS 5:10 MINUTES LONG

  • @section8entertainment961
    @section8entertainment961 Рік тому +140

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using TMPro;
    public class Dialogue : MonoBehaviour
    {
    public TextMeshProUGUI textComponent;
    public string[] lines;
    public float textSpeed;
    private int index;
    // Start is called before the first frame update
    void Start()
    {
    textComponent.text = string.Empty;
    StartDialogue();
    }
    // Update is called once per frame
    void Update()
    {
    if (Input.GetMouseButtonDown(0))
    {
    if (textComponent.text == lines[index])
    {
    NextLine();
    }
    else
    {
    StopAllCoroutines();
    textComponent.text = lines[index];
    }
    }
    }
    void StartDialogue()
    {
    index = 0;
    StartCoroutine(TypeLine());
    }
    IEnumerator TypeLine()
    {
    foreach (char c in lines[index].ToCharArray())
    {
    textComponent.text += c;
    yield return new WaitForSeconds(textSpeed);
    }
    }
    void NextLine()
    {
    if (index < lines.Length - 1)
    {
    index++;
    textComponent.text = string.Empty;
    StartCoroutine(TypeLine());
    }
    else
    {
    gameObject.SetActive(false);
    }
    }
    }

    • @yaboishadowninja
      @yaboishadowninja Рік тому +6

      Thank you. I was following the video but for some reason it wasn't working. However, this did.

    • @Rdect25
      @Rdect25 Рік тому +2

      chad

    • @fullgames8195
      @fullgames8195 9 місяців тому +2

      You are PERFECT

    • @innawoodsfmj
      @innawoodsfmj 6 місяців тому +2

      life saver you are

    • @TwoClutch
      @TwoClutch 5 місяців тому +2

      i love you dad

  • @dr.adammoore
    @dr.adammoore Рік тому +13

    Most efficient Unity tutorial I've ever seen--and it makes perfect sense! You just made my day. And, my first subscribed channel ever. Thank you.

  • @djt3rrv875
    @djt3rrv875 2 роки тому +26

    God thank you SO MUCH for including the complete on click function!!!! A lot of tutorials don't, and it really sucks as a player to be waiting and waiting for this shit to type itself out (especially if you read fast). Such a clean and clear cut tutorial!!! Thank you!!!

    • @BMoDev
      @BMoDev 2 роки тому +2

      Appreciate it!

  • @revmatch6r
    @revmatch6r 3 роки тому +19

    Exactly what I needed. These are the best I've been able to find. Looking forward to more videos soon 🙌

    • @BMoDev
      @BMoDev 3 роки тому

      Thanks dude!

  • @lordkakabel76
    @lordkakabel76 3 роки тому +6

    I love the way you break things down. Very easy to understand.

    • @BMoDev
      @BMoDev 3 роки тому

      delayed answer, but thanks man I appreciate ya 🙏

  • @IceCream-sb7lc
    @IceCream-sb7lc 3 роки тому +17

    Supporting your return by watching the entire ad and this entire tutorial. I request a gourmet dialogue system tutorial with decision making please.

    • @BMoDev
      @BMoDev 3 роки тому +4

      The real mvp 😭

  • @ertyuu35
    @ertyuu35 2 роки тому +8

    Thank you so much. Even though I watched a 30 minute tutorial, I couldn't' do it, but thanks to your 5 minute tutorial, I did it easily.

    • @BMoDev
      @BMoDev 2 роки тому +3

      love to hear it

  • @bigp0y
    @bigp0y 3 роки тому +4

    Missed you, Bmo! Keep up the good work - I find your vids some of the easier tutorials to follow

    • @BMoDev
      @BMoDev 3 роки тому +1

      😘

  • @jehriko7525
    @jehriko7525 2 роки тому +4

    THANK YOU! Been struggling with this because I suck at coding but this helped a ton, def subbing.

  • @Luluskuy
    @Luluskuy Рік тому +1

    This...
    Simply short and sweet. SUBSCRIBED!

  • @eileeng2492
    @eileeng2492 3 роки тому +5

    Finally, you're back.
    Great!
    Keep them coming

  • @Josue-Arreaga
    @Josue-Arreaga Рік тому +1

    honestly you deserve it. This video, the last one I saw, the one before it. Subscribed

  • @crazyconan28
    @crazyconan28 2 роки тому +1

    Thank you BMo for your awesome videos. This was a awesome exercise to follow!

  • @barrelbrothers6896
    @barrelbrothers6896 9 місяців тому

    Thank you man! Super detailed/concise tutorial 10/10.

  • @thepolygonpilgrimage
    @thepolygonpilgrimage 3 роки тому +2

    Brilliant work! Thanks so much for sharing and not wasting time. Love it. Subbed for more.

  • @mortalvoidstudios
    @mortalvoidstudios 2 роки тому

    Thank you so much! This was exactly what I was looking for.

  • @SkeletalDweller
    @SkeletalDweller Рік тому

    This is exactly what I needed, thank you so much!

  • @deadbroadcastpc
    @deadbroadcastpc 3 роки тому +9

    He’s alive!!!!! Glad to see you back man

    • @BMoDev
      @BMoDev 3 роки тому +2

      Thanks man, will try to get back into a rhythm 😅

  • @iwoMalki
    @iwoMalki 9 місяців тому

    Nice simple and fast! Lovely!

  • @Woots
    @Woots 2 роки тому +1

    Wonderful tutorial! Thanks!

  • @quarteroclock1365
    @quarteroclock1365 2 роки тому +1

    man, thank you! this was exactly what i was searching for!

    • @BMoDev
      @BMoDev 2 роки тому

      happy to hear it!

  • @BraedensStuff
    @BraedensStuff Рік тому

    this was just perfect for what I needed

  • @deheane
    @deheane Рік тому +6

    Muito obrigada, em 5 minutos você ensinou mais que tutoriais extremamente longos :D

  • @CASMANWHAT
    @CASMANWHAT 3 роки тому +5

    Yesss!!!!!!!!!!! Welcome back love your tuts

  • @odessialiu3552
    @odessialiu3552 3 місяці тому

    This is so clear and useful!

  • @Noth0ng82
    @Noth0ng82 2 дні тому

    thank you, your tutorial is really helpful

  • @homiek5974
    @homiek5974 Місяць тому

    one of the best tutorials, thanks brother

  • @jjbc5059
    @jjbc5059 8 місяців тому +3

    I love this tutorial. Simple. Well explained. Short. It works. There's nothing else you can ask for. Good job m8!

  • @ozgurgurbuz
    @ozgurgurbuz 2 роки тому

    Thanks for this short tutorial. 😊

    • @BMoDev
      @BMoDev 2 роки тому

      You're welcome!

  • @nickolasmachado9274
    @nickolasmachado9274 Рік тому

    Thank you for this tutorial!

  • @neffthepanda
    @neffthepanda Рік тому

    Great video! Gonna use this for my NPCs.

  • @shang_psycho7414
    @shang_psycho7414 2 роки тому +1

    Thanks! This helped a lot. Something cool to add would be that sounds that play while someone's talking like Undertale.

  • @maayandighorker6930
    @maayandighorker6930 Рік тому

    Great video, thanks! definitely subbing :)

  • @Devlper_
    @Devlper_ Рік тому

    Thanks For this Great Tutorial Bro

  • @bobwinberry
    @bobwinberry Рік тому

    Fantastic - thanks!

  • @imabean9710
    @imabean9710 Рік тому

    Thanks for helping me to make some task game programming

  • @MadGeekGirl
    @MadGeekGirl 2 роки тому +9

    Is there anyway to add this to multiple game objects and have the dialogue system come up when the game object is interacted with in some way? I've tried so many tutorials and methods and have been stuck for days.

  • @fatihbtw5288
    @fatihbtw5288 Рік тому

    thx you so much, great video

  • @happyghoststudios4237
    @happyghoststudios4237 Рік тому

    Such a great video!!! Thank you!!!

  • @GrimCrayontheWraithLord
    @GrimCrayontheWraithLord 5 місяців тому

    OMG! I WAS TRYING OTHER TUTORIALS, AND THEY DIDN'T WORK FOR ME, BUT THEN I COME HERE AND IT WORKS FIRST TRY!!! This is EPIC!!!

  • @GemGameDev
    @GemGameDev 10 місяців тому

    This was effective.. thanks!

  • @arrexu01
    @arrexu01 2 роки тому +6

    Question. How would I be able to mix this with a multiple choice dialogue system?. Like, say my player would have a voice line, then naturally the npc would respond, but only once and the conversation is done.
    So what I mean is, how can i transition between both?

  • @Eduard02834
    @Eduard02834 2 роки тому

    Thanks really helpful and less time !!!!

  • @perttihakala9847
    @perttihakala9847 2 роки тому

    awesome! just the thing i need! :3

  • @mediamermaid333
    @mediamermaid333 Рік тому +1

    Thank you!!

  • @hejhejhej952
    @hejhejhej952 5 місяців тому

    Thank you kind sir!

  • @vain_rafael2868
    @vain_rafael2868 7 місяців тому

    2 years old, still very useful!

  • @wicksley
    @wicksley 10 місяців тому

    Awesome thank you :D

  • @cricadev
    @cricadev 3 роки тому +5

    Hey bro, how can I do this but with the new input system from unity, GetMouseButtonDown, doesn't exist anymore.

  • @m4v3n95
    @m4v3n95 2 роки тому

    Really helpful!

    • @BMoDev
      @BMoDev 2 роки тому +1

      Love to hear it

  • @lejocarry
    @lejocarry Рік тому

    Really good :)

  • @HivemindZalgo
    @HivemindZalgo Рік тому +1

    Jesus, why is it so hard to do something like what u did? Other videos take up 20-30 minutes of my life with extra stuff that's unnecessary but if I don't add the code will break. Thanks a lot!

  • @nevimkde9537
    @nevimkde9537 Рік тому

    Absolutely love this video!!! Helped a lot, but I have a question. If I wanted to make multiple instances of waiting function for some reason code doesnt execute them at all. If I have multiple IEnumerators nor If I have If function in one IEnumerator, there it will only execute the original and if I change the text appearance to that another if statement it will completely skip any dialogue at all (my main reason of doing this if because the character not always speaks at same speed e.g. if he is surprised he will swallow some of his words or in cutscener or non-interactable dialogue which will appear and dissapear of its own). Thank you if you are willing to help me!

  • @ilypavan
    @ilypavan 25 днів тому

    Thank You.

  • @isaacwiseau8130
    @isaacwiseau8130 Рік тому

    this is very good good but with all the zooming around I wish I could see more of the Unity window to see other values while working at my own pace

  • @infosource3153
    @infosource3153 2 роки тому

    Excellent

  • @animationanimator5143
    @animationanimator5143 Рік тому +1

    Is there a way so that certain elements aren't said in the dialogue box until the player reaches a certain point?

  • @patrickalexander1737
    @patrickalexander1737 Рік тому +1

    And is it possible to add images in the background that transition with the dialogues?

  • @PRAVEENKUMAR-xg6qe
    @PRAVEENKUMAR-xg6qe 2 роки тому

    now i am in a good mood

  • @stevenhays6816
    @stevenhays6816 7 місяців тому

    Top notch vid bloke

  • @NAgamerOfficialYT
    @NAgamerOfficialYT Рік тому +1

    is there a way to make it pause for a small moment for stuff like commas or something like that?

  • @Val0r2
    @Val0r2 6 місяців тому +1

    Question: How would I go about making new dialogue appear whenever my player returns to the same scene instead of it just repeating same stuff every time the scene is loaded?

  • @madpenguin58
    @madpenguin58 3 роки тому +6

    Hi @BMo! Is there some kind of way that one could add some kind of trigger collider on something like a sign or NPC and have the character hit a button like the space key in order to start the dialogue instead of having it start at the beginning of the game? I have tried some things myself but I just can't figure this one out. Thanks!

    • @BMoDev
      @BMoDev 3 роки тому +4

      Yeah 100%, you just need that trigger to execute the StartDialogue method. I have an "Interaction" tutorial, you can use the principals in that to call the StartDialogue Method!
      ua-cam.com/video/cLzG1HDcM4s/v-deo.html

    • @madpenguin58
      @madpenguin58 3 роки тому +2

      @@BMoDev Ok! Thank you very much! I was also wondering (sorry I have so many questions. I should probably just get better at code on my own.) if there was some kind of way to implement a response, and have the dialogue loop back to the beginning every time you play it. Thanks! I have been following a bunch of your 2D tutorials and am learning a lot about making games!

    • @IvanThGreat
      @IvanThGreat 2 роки тому

      @@madpenguin58 Hello, I would like to ask how did you get it to work with the Interact system?

  • @awawa5594
    @awawa5594 9 місяців тому

    How do you give control back to the main game after dialogue ends? I'm having difficulties wording what I mean but after the dialogue runs using this method, I want to then get objects to show or be able to click on buttons but I don't want to add that code directly in the Dialog Manager as it'd make it messy and not specific to the dialog but I don't know how else to do it?

  • @EnemyOTS
    @EnemyOTS 2 роки тому +3

    LMAO impressive!
    5 minutes indeed. Great tutorial

    • @BMoDev
      @BMoDev 2 роки тому +1

      Appreciate ya

  • @Skyblade22
    @Skyblade22 3 роки тому +1

    this the good stuff

  • @karnecita
    @karnecita 6 місяців тому

    gracias, sos un capo, excelente tutorial 10/10

    • @karnecita
      @karnecita 6 місяців тому

      using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      using TMPro;
      public class Dialogue1 : MonoBehaviour
      {
      public TextMeshProUGUI textComponent;
      public string[] lines;
      public float textSpeed;
      private int index;
      // Start is called before the first frame update
      void Start()
      {
      textComponent.text = string.Empty;
      StartDialogue();
      }
      // Update is called once per frame
      void Update()
      {
      if (Input.GetMouseButtonDown(0))
      {
      if (textComponent.text == lines[index])
      {
      NextLine();
      }
      else
      {
      StopAllCoroutines();
      textComponent.text = lines[index];
      }
      }

      }
      void StartDialogue()
      {
      index = 0;
      StartCoroutine(TypeLine());
      }
      IEnumerator TypeLine()
      {
      foreach (char c in lines[index].ToCharArray())
      {
      textComponent.text += c;
      yield return new WaitForSeconds(textSpeed);
      }
      }
      void NextLine()
      {
      if (index < lines.Length - 1)
      {
      index++;
      textComponent.text = string.Empty;
      StartCoroutine(TypeLine());
      }
      else
      {
      gameObject.SetActive(false);
      }
      }
      }

  • @RakeBye22
    @RakeBye22 Рік тому

    thank you

  • @arianrivaz5982
    @arianrivaz5982 11 місяців тому

    hey.thanks for the great video.any ways i could use this twice? for example.i have a nurse charecter.first she starts the dialogue.then after she finished i would like to use this method once again on my player charecter and (for example answer the nurse).i would really apreciate if you answer.

  • @someobscuremusicchannel
    @someobscuremusicchannel 2 роки тому

    the red x in the corner was killing me man

  • @muttlymartin2621
    @muttlymartin2621 Рік тому +1

    ngl i got a really odd error when goin though his steps, its displaying 0 which i suspect is the index then flashes each character after the number. ive double checked my code to his but i dont understand wondering if someone might of had the same issue?

  • @MayKayy
    @MayKayy 2 роки тому

    Thanks

  • @tomo8940
    @tomo8940 Рік тому +1

    Anybody know why am I getting "Object reference not set to an instance of an object Dialogue.Update() (at Assests/Dialogue.cs:26"?
    It's for a college project :(

  • @yankates3752
    @yankates3752 Рік тому

    thanks a lot

  • @potantirittisak8494
    @potantirittisak8494 2 роки тому

    Thank uuu

  • @macros3570
    @macros3570 3 роки тому +1

    thank you so so much

  • @berkepeksen5584
    @berkepeksen5584 Рік тому

    good stuff

  • @dralexander6211
    @dralexander6211 Рік тому +1

    Hello I was wondering if you could help me I would like to know how to stop the text from showing up when the game starts. I would highly appreciate it if you could give me some advice :)

  • @jordanthebestlass8483
    @jordanthebestlass8483 2 роки тому

    how do i keep the the text from moving when i have it's alighnment centered?

  • @ginoantenucci6424
    @ginoantenucci6424 Рік тому +2

    I am surprised it wasn’t one of those videos that has no talking and just coding at 3x

  • @dovmandev
    @dovmandev 4 місяці тому

    I expect from you a package solution for medium-sized projects like this in the video

  • @charm558
    @charm558 Рік тому

    ty so mch

  • @EricYoungVFX
    @EricYoungVFX 3 роки тому +4

    You're amazing...

  • @smarttarded
    @smarttarded 8 місяців тому +1

    This is actually perfect for silent protagonists who isn't expected to respond to NPCs

  • @yanz3e14
    @yanz3e14 3 роки тому

    hi how do i move to another scene whenever there is no more dialogue?..can you help ?

  • @timothy7411
    @timothy7411 6 місяців тому +1

    i try to put this on timeline but the firs line only showing one character how do i fix this??

  • @fawzamaisarah459
    @fawzamaisarah459 Рік тому +1

    Hi! im following this tutorial but i dont have "text component" and "lines" under my dialogue script, so i cant drag the text into the component. how do i fix this? i need help for my university project.😭

  • @c-14games
    @c-14games 11 місяців тому +1

    How can I made a dialogue with choices using this method?

  • @triggerdc3gaming617
    @triggerdc3gaming617 2 роки тому +2

    great video! but does anyone know how to have different lines of text for two separate NPCs? my brain is fried and idk how to pull it off

  • @byTrident
    @byTrident 2 роки тому

    thanks man

    • @BMoDev
      @BMoDev 2 роки тому

      You bet

  • @priskon5950
    @priskon5950 Місяць тому

    Hi, I have attached this to 2 different gameObjects and have given them unique strings. I noticde that they share the index[lines] variable, so when I interact with 1 object, I can't move to the next line because the script reads both index[lines], anyone knows how to fix that?

  • @aliangemaxelcrooc877
    @aliangemaxelcrooc877 7 місяців тому

    If i have only 1 element or text, it is not showing if i try to make the dialogue box appear again for the second time

  • @tfroz469
    @tfroz469 Рік тому +1

    can someone tell me how do i put this dialogue.. like.. to "interact with npc"

  • @sarmsaklomlet5852
    @sarmsaklomlet5852 Рік тому

    thanks:)))

  • @Bittergiggle_gaming
    @Bittergiggle_gaming 11 місяців тому

    Thanks! This helped me with Normal Kindergarten! Now Nabnab, Chef Chick, Hopping Bun, Etc, Can Now Say What I Wanted It To Say!

  • @sl4ve576
    @sl4ve576 7 місяців тому +1

    That's cool, but how do I link the dialogue to activate by talking to an Npc?

  • @yongch6407
    @yongch6407 2 роки тому

    Could you explain the NextLine() logic?