Unity 2D Platformer Tutorial 36 - Dialogue System

Поделиться
HTML-код
  • Опубликовано: 4 фев 2025

Комментарии • 82

  • @camonbauDuc
    @camonbauDuc Год назад +2

    Thanks for the tutorials + explaination, it's too bad that this video getting less view. Anw thanks again Sir

  • @jonasneumann1429
    @jonasneumann1429 8 месяцев назад

    Wonderful video. I like how you explain everything at great pace and even write all the notes!! thx

  • @daftdemongr
    @daftdemongr 2 года назад +1

    Amazing tutorial and very helpful, I've searching for a dialogue system with more than 1 sentence. Bigs buddy!

    • @Antarsoft
      @Antarsoft  2 года назад

      Glad it's helping you 😇😇 do subscribe and join our channel to support us ❤️

  • @beri4138
    @beri4138 3 года назад +3

    This is very similar to the system I made for my game back in 2020.
    I think adding a "profile picture" of the person speaking would be a nice touch. Cool stuff.
    I'm planning to return to work on my game after more than a year and a half apart. After my finals in february-march, I'll return and finish at least a respectable demo version of my game. Hopefully I'll still be able to understand my old spaghetti code.
    As for more than just a demo: For that, I'll have to learn pixel art and animation to a respectable level which I don't think I can do.

    • @Antarsoft
      @Antarsoft  3 года назад

      Yeah would be a nice touch to have an icon.
      Best of luck in your exams, and it's very nice to hear that you'll resume your game.
      Cheers

  • @mrpikaonfire3195
    @mrpikaonfire3195 2 года назад +2

    Thank you everything was explained super clearly this is amazing ! this truely helped me a lot

    • @Antarsoft
      @Antarsoft  2 года назад

      I'm very glad it's helping you 😇😇

  • @3rdperson2
    @3rdperson2 2 года назад +1

    Great job! Such a big help. I've been trying to crack my dialogue system issue for while now, trying different tuts, but this video was perfect! Thanks! You have a new sub!

    • @Antarsoft
      @Antarsoft  2 года назад +1

      Cheers 😁🙏🏻🙏🏻

  • @Wowcheeeee
    @Wowcheeeee Год назад +1

    Why so few views? The video is very good and helped me, thanks a lot to the author! Subscribed!

    • @Antarsoft
      @Antarsoft  Год назад

      I could guess it's a very niche topic.
      Thank you for your support

    • @Wowcheeeee
      @Wowcheeeee Год назад

      @@Antarsoft Excuse me, can I ask you a question? For some reason, the private bool "started" doesn't switch to false at the end of the dialogue and instead of ending the dialogue just starts from the beginning again, can you please give me advice or a clue for solving this issue?

    • @Wowcheeeee
      @Wowcheeeee Год назад

      It's strange but on another object, the script works. The difference between objects is that in one object, we have a box collider only as a trigger; in the other object(in which all works) we have two colliders, one like a trigger and the second like a regular collider.

  • @davidesette3629
    @davidesette3629 2 года назад +2

    really clean job🙌

    • @Antarsoft
      @Antarsoft  2 года назад +1

      Thank you! Cheers!

  • @its_homayoun
    @its_homayoun Год назад +1

    this video was really nice
    thank you

  • @karmelin7485
    @karmelin7485 7 месяцев назад

    perfect video tutorial thank you

  • @nestiboy
    @nestiboy 2 года назад +2

    This was SUUUUUUPERRR helpful, thank you so much! Very well explained too ;)

    • @Antarsoft
      @Antarsoft  2 года назад

      🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

  • @ken020589
    @ken020589 2 года назад +1

    This is what I looking for!!👍

  • @kechrimpari2348
    @kechrimpari2348 2 года назад +2

    Literally was just thinking about doing this and saw it on my recommended!
    Also, does anyone else hear ringing during this video?

  • @sukuna_ryomen_0
    @sukuna_ryomen_0 Год назад +1

    thank you so much

  • @dkn1323
    @dkn1323 5 месяцев назад

    thanks u very much :3

  • @mortalvoidstudios
    @mortalvoidstudios 2 года назад +3

    How might you include an interaction where the character responds after the NPC is done chatting? I can't seem to get something like that working.

    • @Antarsoft
      @Antarsoft  2 года назад

      I'm not fully aware of what you mean by respond but to put it in simple terms, let's say you want the npc to talk several dialogues, after all these dialogues are done you can invoke an Action where the player would subscribe to it or you can toggle a Boolean on that will allow the player to interact.

  • @mangooo891
    @mangooo891 Год назад

    If there is an error that repeats the conversation without ending when moving to another scene, try changing the Update method of the "DialogueTrigger" script to the FixedUpdate method. The conversation ends correctly.
    For now, I solved it this way, but if there is another better way, please let me know.

    • @mangooo891
      @mangooo891 Год назад

      It seems better to leave the Update of the "DialogueTrigger" script as is and change the Update of "Dialogue" to LateUpdate.

  • @nafisahfirzana7975
    @nafisahfirzana7975 11 месяцев назад

    Hello im new to unity, i do all the instructions correct but my dialogue only start with one element and doesnt show the 2nd one... Can anyone fix this issues?

  • @monkeman7601
    @monkeman7601 2 года назад +3

    A quick question
    When the dialogue finishes it starts from the beginning once again
    I did what you did and also tried to get your code from your github but still couldn't fix it
    Do you know how I can fix it?

    • @Antarsoft
      @Antarsoft  2 года назад

      Does the dialogue start by itself or do you click an interact button ?

    • @monkeman7601
      @monkeman7601 2 года назад

      @@Antarsoft i have an interact button but when i use the button in the last sentence rather than closing it goes back to first sentence

    • @LSPTaris
      @LSPTaris 2 года назад

      @@monkeman7601 Having this same problem right now. Was fine at first but after I reopened my project it started acting like this

    • @elfe_art
      @elfe_art Год назад

      I have this problem too, but if resave the code it works correctly again , hmm

    • @Wowcheeeee
      @Wowcheeeee Год назад

      Hello friend! Have you solved it?

  • @guilhermesaraiva3846
    @guilhermesaraiva3846 Год назад

    is possible use this in my 3d academic game ?

  • @seaderwerks3046
    @seaderwerks3046 Год назад +1

    I've copied this code from your source, marked ever checkbox and set every perimeter, yet when I get close to my npc, no indicator and when pressing E, nothing happens, no scrip or anything.
    Is this because of the untiy update or something? I've been searching endlessly for a dialog box to come up with interacting with a npc but all of them result with nothing happening when you interact. Anyone have any leads at all? Google and youtube results are all 1+ year old and even with copying exactly what is present in the video on a totally different project all by itself, I still get these same results.

    • @nGmms
      @nGmms Год назад +1

      Are you sure you checked the "Is Trigger" on the "Box Collider 2D" on the NPC?

    • @seaderwerks3046
      @seaderwerks3046 Год назад +1

      @@nGmms Actually the issue was I had not dragged the indicator object into the script fields. I had ment to comment back but I got wrapped up in other bugs.

    • @Antarsoft
      @Antarsoft  Год назад +1

      Sorry for late reply, but I'm glad it got resolved

  • @sure759
    @sure759 2 года назад +2

    i dont have Text_Mesh_Pro
    so i used 3D text but its not working
    how can i get TMP?
    i searched .... but i found 10 TMP
    what did you use?
    please help

    • @Antarsoft
      @Antarsoft  2 года назад +1

      Hey،
      What exactly do you mean by not working?
      And you can always get the tmp via the package manager.

    • @sure759
      @sure759 2 года назад +1

      @@Antarsoft so how to access 3DText through script?

  • @alligator4397
    @alligator4397 2 года назад +2

    That was super helpful and exactly what i was looking for! Just a simple question: I created my dialogue system and a few different GameObjects with this script, and for some reason my dialogues repeats everytime. Do you know something about it? It happens when i change the scene

    • @Antarsoft
      @Antarsoft  2 года назад

      Hey,
      I wouldn't be able to suggest the proper answer, but from what you're saying you need to see when is the starting method of the dialogue is called, which will help you figure out the repeat.
      For the scene change it would be the same thing, something is happening in start or some script is triggering the dialogue on start

    • @alligator4397
      @alligator4397 2 года назад +1

      @@Antarsoft Ok... I'll try to figure it out what is happening. If i dont succeed I will try to contact you again in the comments! Ty to reply my question, and again, your tutorials are very helpful to understand unity and create a game

    • @Antarsoft
      @Antarsoft  2 года назад

      Sure, better join our discord channel myself and others can help out

  • @orhangunes3911
    @orhangunes3911 2 года назад +1

    thanks man

  • @christinpark6012
    @christinpark6012 Год назад

    for some reason it isn't working :(
    i added the dialogue script and added the components for the window,indicator, and dialogue text
    on the npc, I added the dialogue_trigger and put in the dialogue
    I have "is trigger" on only the npc box collider, they are on the same layer, and the player is tagged as player
    is there something ive missed?

    • @Antarsoft
      @Antarsoft  Год назад

      Would need more context, but one if them should have a rigidbody and there should be in the same z axis position.
      Do a debug statement for help

    • @christinpark6012
      @christinpark6012 Год назад

      @@Antarsoft thank you so much for your reply! I've been having a lot of trouble with this
      I've checked the z position and rigid body, but am not sure about the rigidbody, since this is the only tutorial of yours that I'm following and my other settings/scripts might be uncompatible with it
      if its possible, could I screenshare on your discord?

    • @Antarsoft
      @Antarsoft  Год назад

      I won't be able to do this much detailed assistance unfortunately.
      But this video is part of a series, and if you have issues with collision, and triggers please sell Unity's manuals and forums.

  • @ngworks.
    @ngworks. Год назад

    I followed the whole tutorial (its very good btw) but i ran into a problem. Everthing works but the textbox doesn't show the elements (dialogues) but just the sample text of the tmp. Does anyone knows why this is

  • @Augustidoit
    @Augustidoit 2 года назад +1

    can anyone give me some advice? when i press e again my windows closes and the text dosent appear again

    • @Augustidoit
      @Augustidoit 2 года назад

      nvm i fixed a slight issue of index always being greater

    • @Antarsoft
      @Antarsoft  2 года назад

      Would be bettter if you could debug the issue more in depth then provide additional details.

  • @matthewcaffee2125
    @matthewcaffee2125 Год назад

    when i do this, every instance of a dialog in the scene triggers at once, all the solutions i've found to this was setting things to not be static but nothing i currently have in the script is static. is there any way to fix this without completely redoing it?

    • @matthewcaffee2125
      @matthewcaffee2125 Год назад

      nvm, it'd seem i messed up the collision check stuff majorly so it always triggers the script if you press z within the scene

  • @monicayang1366
    @monicayang1366 Год назад

    Hiiii! Why the text isn’t show in the game mode?

    • @Antarsoft
      @Antarsoft  Год назад

      Hi,
      I can't give an answer as you haven't presented enough details on the issue.

  • @jacksonbaldwin3463
    @jacksonbaldwin3463 2 года назад

    fantastic video, I love your tutorials!
    Right now, I'm trying to find a way to randomize the dialogue you get from an NPC every time, so I need to be able to pick from a "List" of "Lists" of options. Do you know any way to do this cleanly?

    • @Antarsoft
      @Antarsoft  2 года назад +2

      Of course, I'd assume you have setup the list and the dialogues inside, you need to use the Random method from unity.
      Random.Range(x,y);
      where x is the minimum and y the maximum (maximum not included), you should put x as zero and y as the count of your list.
      Here's the link to more details of the random method
      docs.unity3d.com/ScriptReference/Random.Range.html

    • @jacksonbaldwin3463
      @jacksonbaldwin3463 2 года назад

      @@Antarsoft thanks Anatarsoft! This is pretty much what I ended up using in my prefab. Love your tutorials ❤️

  • @veslyju1984
    @veslyju1984 Год назад

    My text is behind the square even change layout help me

    • @jmanhertz
      @jmanhertz 8 месяцев назад

      Check Tour sorting layers on each gameobject

  • @barsdogu2261
    @barsdogu2261 2 года назад

    Hello! I want to make my character to respond to NPC but I don't know how to do that. Can someone help me?

    • @Antarsoft
      @Antarsoft  2 года назад

      Hey,
      What do you mean by respond to NPC exactly ?
      If you mean when your character passes near an NPC, you can simply add a 2d/3d collider to your NPC then make sure the NPC will have something unique like a specific tag "NPC" and use OnTriggerEnter or OnTriggerEnter2D to detect if you trigger with someone with tag "NPC" then put whatever logic you want inside.

  • @Baybayy-d6f
    @Baybayy-d6f 2 года назад +1

    36:14 I can't see what you're doing

    • @Antarsoft
      @Antarsoft  2 года назад +1

      The cam must have blocked some lines, my bad
      Feel free to get the full script via the github link in the description

  • @jozimastar95
    @jozimastar95 3 года назад +2

    gona use it in my game lol

    • @Antarsoft
      @Antarsoft  3 года назад +2

      I'm glad it'll help you out.
      Please do subscribe if you haven't already.
      Also I'd love to see your progress on your game in our discord server 😇
      Cheers

    • @jozimastar95
      @jozimastar95 3 года назад +1

      @@Antarsoft I wanna ask abaut somethink. in my game (2d) there arw somethink like side characters that must follow the player I used vector 3 go forward and transform but it end up that they stuck in the air or keep teleporting into their first ever location. is there any way to keep them close to the character without losing any of the values? (some of them are slower than the other or can't jump)
      (if you interested the idea of the game is that random ai ropot land in wrong location in earth instead of space so it try to learn from anythink to survive or go faster caus it have a lot of skills but have no idea how they work)

    • @Antarsoft
      @Antarsoft  3 года назад

      Hey,
      That's a bit advanced feature and yea it requires some AI implementation.
      I haven't done it personally before, but I'd assume using rigidbody and apply movement towards player and then auto detect obstacles and jump.
      In 3D I used pathfinding

    • @jozimastar95
      @jozimastar95 3 года назад +1

      @@Antarsoft thanks im gona try it

    • @jozimastar95
      @jozimastar95 3 года назад +1

      @@Antarsoft it acultly work so well
      (I used pravite game opject called target and make the target swixh to the last character that move and set this to unactive when I start platforming with one of them like if( input. get key down (s) )
      (target = turtle )
      else ( target = frog) and the 5 camera follow in the late update so it acultly have enught time to switch target and for the pathfinding I make their collider in active so they acultly can telepoet if you intested to knoe)