Тёмный

Undertale DIALOGUE|CUTSCENE in Unity (Episode 1) 

Pandemonium
Подписаться 19 тыс.
Просмотров 64 тыс.
50% 1

In this video we're gonna create a basic dialogue system in Unity which you can use for cutscenes or talking with NPCs.
“You have something called "determination." so as long as you hold on... so as long as you do what's in this tutorial... i believe you can create a dialogue system.”
― Sans (kinda)
Learn how to make an Undertale Unity3D dialogue|cutscene system.
● Tutorial resources: drive.google.com/open?id=1noJ...
● Download Complete Project: drive.google.com/open?id=1Opv...
Subscribe and turn on the notifications if you're interested to see more!
➤ Discord : / discord
➤ Patreon: / pandemonium_games
➤ Instagram: / pandemonium_games
➤ Twitter: / pandemoniumnick
➤ Itch: nickbota.itch.io/
#undertaledialogue #gamedev #unity3d #tutorial#madewithunity #undertale #dialogue #pandemonium #unitydialogue #pandemoniumgames
Tags: undertale unity3d,undertale dialogue unity,unity dialogue,unity dialogue system,undertale unity,undertale unity engine,pandemonium games unity,unity dialogue menu,undertale dialogue|cutscene,unity undertale,Undertale DIALOGUE|CUTSCENE in Unity (Episode 1),dialogue system unity,unity dialogue tutorial,unity dialog,undertale dialogue,unity how to make undertale,unity npc dialogue,Undertale DIALOGUE,undertale cutscene unity
0:00 Useless Intro
0:49 Dialogue Base Class
1:30 Visual Example of how it works
2:29 Dialogue Line Class
3:36 First Working Version
4:09 Adding Custom Color and Font for each dialogue line
5:07 Customizing the speed with which letter appear
5:44 Adding Sounds
8:20 Sans Voice
8:50 Adding Graphics
9:50 Character Portraits
11:20 Making Multiple Lines appear in sequence
13:29 Adding Time Delays before changing lines
14:43 Changing Lines with mouse clicks
15:06 Turning off dialogue when done
15:30 Final version showcase
16:05 Want me to extend this and add more options?

Игры

Опубликовано:

 

29 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 392   
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
0:00 Useless Intro 0:49 Dialogue Base Class 1:30 Visual Example of how it works 2:29 Dialogue Line Class 3:36 First Working Version 4:09 Adding Custom Color and Font for each dialogue line 5:07 Customizing the speed with which letter appear 5:44 Adding Sounds 8:20 Sans Voice 8:50 Adding Graphics 9:50 Character Portraits 11:20 Making Multiple Lines appear in sequence 13:29 Adding Time Delays before changing lines 14:43 Changing Lines with mouse clicks 15:06 Turning off dialogue when done 15:30 Final version showcase 16:05 Want me to extend this and add more options? Hope this helps people navigate this long-ass video.
@microwave1852
@microwave1852 3 года назад
0:59 what did you clicked, that you could click "IEnumerator - using System.Collections;"?
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
@@microwave1852 Alt-Enter while keeping your selection cursor on the ienumerator word. Check this out for more shortcuts: docs.microsoft.com/en-us/visualstudio/ide/default-keyboard-shortcuts-in-visual-studio?view=vs-2019
@microwave1852
@microwave1852 3 года назад
@@PandemoniumGameDev thx
@programero7313
@programero7313 Год назад
Here with my small contribution, because now we use TextMeshPro: Replace Text with TMP_Text in both scripts
@blindexgames
@blindexgames Год назад
Dude, thank you so much, you saved my game!
@ericateaford6019
@ericateaford6019 5 месяцев назад
bless you man. i was struggling with this
@danadifilippantonio2898
@danadifilippantonio2898 4 года назад
This is an EXCELLENT tutorial! Probably the best dialog tutorial I've watched, and I think I've watched almost all of them by now! Great explanations, editing and everything! I would LOVE to see another video on this about branching dialog, etc.
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
This is really high praise, thank you! Episode 2 is 50% done, it won't have branching dialogue unfortunately, will leave that for episode 3 I guess.
@rmcquade19
@rmcquade19 4 года назад
Pandemonium Games Excited for an episode 2 and beyond! Even getting these attached to certain NPCs to trigger sequences would be AWESOME. Thanks!
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
@@rmcquade19 Managed to get rid of that error?
@denyss5962
@denyss5962 3 года назад
It works perfectly! please keep doing these tutorials, I'd love to see how to add multiple answers!
@RATE.LIMITED
@RATE.LIMITED 2 года назад
Super helpful! Not making an Undertale or Deltarune game, but learning how the dialogue actually works is essential.
@lucwolthers921
@lucwolthers921 3 года назад
One of the best tutorials I have come across! thanks
@atreyuslilcottage4053
@atreyuslilcottage4053 4 года назад
you have no idea how long I've looked for a proper dialogue system that would work for my game!!! I hope that you get popular enough for others to see your wisdom!
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
Ah, thank you for the kind words! I'll keep putting up content and hopefully people will find it :). BTW episode 2 of this series is being recorded now.
@MrJQ3d
@MrJQ3d 3 года назад
Props! You've done a great Job! Helped me a lot.
@programero7313
@programero7313 Год назад
omg what a great level this tutorial has, thanks for existing
@pkmtrainerbenny
@pkmtrainerbenny 3 года назад
This is just, amazing!!! Thank you so much for your video and for sharing your knowledge!
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
more than happy to help :)
@dirktrash3455
@dirktrash3455 Год назад
Thanks for the video man! Super detailed and helpful, love it!
@vladkanunnikov1443
@vladkanunnikov1443 2 года назад
Thank you for this beautiful video! It's awesome!
@hidrent9142
@hidrent9142 3 года назад
Your amazing! Just wow! Thank you so much man! You can't believe how much you helped me!!!!
@ArchitectEnterprises
@ArchitectEnterprises 3 года назад
Ngl this is actually perfect for a story mode part of my game!
@sunkenship9552
@sunkenship9552 Год назад
Great video! It helped a lot :D Thank you!
@toadd
@toadd 4 года назад
Thanks for this! It is a great video!
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
Hey man, this means the world to me, thanks!
@vermalreik4646
@vermalreik4646 8 месяцев назад
😃Woh, thanks! It's just what I was looking for 💖
@belongto2269
@belongto2269 3 года назад
It's absolutely what I want!Thank you so much!:)
@matheusmartinscremes5090
@matheusmartinscremes5090 3 года назад
Thanks for the tutorial!
@David-yp7ix
@David-yp7ix 3 года назад
THX man you are my hero !
@totsmalotes2082
@totsmalotes2082 2 года назад
Thank you for this i Subscribed and Liked the video
@NeoYT6969
@NeoYT6969 11 месяцев назад
for the people having nullreference error: create new ui/legacy/text not text mesh (idk why it doesnt work but dont use text mesh use legacy text)
@emilythebaptist
@emilythebaptist 6 месяцев назад
Thank you for this comment! It now works for me
@name05s
@name05s 4 месяца назад
soo true bestie!!! thank you
@saifee7899
@saifee7899 2 года назад
this tutorial is really good and easy to follow and has good explaining, my only feedback is to zoom in onto the code and go a bit slower
@HiBye-iz1fd
@HiBye-iz1fd 3 года назад
thank you so much, you just saved my project :')
@moonstonestudios8719
@moonstonestudios8719 4 года назад
Amazing tutorial! Please make more dialouge!
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
hey thanks a ton! You mean to make this more advanced? Branching dialogue and stuff?
@moonstonestudios8719
@moonstonestudios8719 4 года назад
@@PandemoniumGameDev Yes please!
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
@@moonstonestudios8719 you got it, I'll do my best to make some time for it this week
@moonstonestudios8719
@moonstonestudios8719 4 года назад
@@PandemoniumGameDev thank you!
@abhinavkhatana
@abhinavkhatana 5 месяцев назад
what if i want that when dialogue ends it transition to a different scene like to main level
@genericchannel8478
@genericchannel8478 2 года назад
Hi! I want to know how to play an animation after the dialogue ends but i dont know how. any help?
@parasyte8230
@parasyte8230 Год назад
Hey thanks so much for this video! Do you how would implement this using timeline? I want a certain dialogue to start at a certain point of the cutscene and only advance in the cutscene once the continue key is pressed. Basically just like an undertale cutscene
@killot9149
@killot9149 2 года назад
Is there a way to skip to the end of a dialogue line with a mouse click?
@astraea4794
@astraea4794 2 года назад
The sound does not turn off after the writing process is finished. How can I fix this?
@chasm9699
@chasm9699 2 года назад
I have a question, how do I pause the game during the dialogue and unpause it after the dialoogue turns off
@holdenthompson1449
@holdenthompson1449 2 года назад
Hey, after I add the text color and text font functionality, it does not display when I hit start. The code is perfect, it's exactly what you have. But for whatever reason when I add these features, it does not display the text when I hit the start button.
@holdenthompson1449
@holdenthompson1449 2 года назад
It does however work with your unity project. Yours works just fine when I boot it up and play it, after I enable the sprites and sounds that is.
@PandemoniumGameDev
@PandemoniumGameDev 2 года назад
@@holdenthompson1449 It happened to more people, the problem is that the color parameter has 0 opacity, so it's transparent. The text is there you just can't see it. Make sure to change the opacity to 100%.
@holdenthompson1449
@holdenthompson1449 2 года назад
@@PandemoniumGameDev My God 🤦. How could I be so foolish? Thank you! I appreciate the quick response!
@PandemoniumGameDev
@PandemoniumGameDev 2 года назад
@@holdenthompson1449 as I said, easy to miss. Lotta people got this problem.
@user-qz9lo5yc9f
@user-qz9lo5yc9f Год назад
@@PandemoniumGameDev I had the same error, thank you very much xD
@suraj8356
@suraj8356 3 года назад
Instead of using the mouse click how can i replace with mobile button on click()? a small code/ info line please, really liked this tutorial just wanted to know how to use the skip with button usage? Thanks
@azraelpfenning2393
@azraelpfenning2393 2 года назад
hi im getting this error Assets\DialougueLine.cs(19,45):error CS1503: Arguement 2: cannot convert from 'TMPro.TextMeshPro' to UnityEngine.UI.Text' Can someone please tell me what Ive done wrong and how to fix it also Ive looked at opacity but my text isnt displaying so I think it has something to do with this
@rmcquade19
@rmcquade19 4 года назад
AH sorry, getting stuck with a NullReferenceException... I think my textHolder.text is returning a null? I see it really wants to have a bracket suffix {x,y} but not sure what to have. Any help would be SO helpful!
@rmcquade19
@rmcquade19 4 года назад
FIXED dumb me didn’t realize I was using a TextMeshPro object instinctually-still learning!!
@SaadTheGlad
@SaadTheGlad 3 года назад
How did you solve the problem? Please help I'm always getting NullReferenceException errors...
@wasbeerinc.3656
@wasbeerinc.3656 9 месяцев назад
When i put the characterimage as a child of the dialogue line, it doesnt become active when i press play. please help
@owzok7087
@owzok7087 4 года назад
tysm wise man !! :)
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
You're very welcome Toast man :D JK, thanks a ton for watching this :)
@seanthecommandblockenginee1238
hey, I was wondering how I would make the Karma system for health
@rispy4736
@rispy4736 3 года назад
can u make something like when i come to guy and press c to start conversation
@NeoLoveCookie
@NeoLoveCookie 2 года назад
I've never seen such an interesting tutorial. The example of Undertale was cool !
@chl_att
@chl_att 3 года назад
Hello ! I have a problem with my coding : when I play the game, the console says that " Field'DialogueLines.textColor' is neever assigned to, and will always have its default value" and it says that for every elements of my game, the DialogueLines.imageHolder, DialogueLine.textFont, ... So I have no idea where does it come from and how I can fix it ? Does anybody have an idea ?
@stanferrolino12
@stanferrolino12 3 года назад
it means there is no code that sets those values. Maybe check if you're setting the values correctly?
@masked9405
@masked9405 3 года назад
My dialog1 isnt showing up in the Game is just the text and i don't know why
@muharremsaitcoktas3548
@muharremsaitcoktas3548 3 года назад
What is the advantage of making DialogueBaseClass and inheriting it? So what if we write the WriteText function directly into the DialogueLine script?
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
Abstraction. In this way you can make other scripts that behave differently but still have the ability to show text in way. For example you can make a Cutscene script and make it load the game when it's done, etc. In this case it's not strictly necessary, I agree, but just in case you want to extend it into something more.
@yukononun
@yukononun 4 года назад
Could this work with Unreal? I was interested in implementing a system like this for my game, but unfortunately I don't use Unity.
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
I honestly have no idea because I haven't worked with Unreal. I believe the logic should be the same, so that's the good part. The challenge will be to adapt all the code from C#/Unity to C++/Unreal. Good luck, hope you find a way to do it!
@deanwilkes-rios3012
@deanwilkes-rios3012 3 года назад
Hi, amazing tutorial. Just wanted to know, how would someone go about changing the background image in tune with the dialogue (like a cutscene). Very similar to the example you gave at the beginning. Thank you
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
Make a UI image and attach a script on it. Use the same logic we used in this tutorial, you make an array of sprites and every time your player presses Space or click, you change the image.sprite = arrayOfSprites[currentImage]. Let me know if it's clear
@deanwilkes-rios3012
@deanwilkes-rios3012 3 года назад
@@PandemoniumGameDev Awesome, thank you
@UpBeeGames
@UpBeeGames 3 года назад
Hello, I would like to modify it, could you help me? I want the exchange of phrases to be when clicking on the "space" button, it could help me. How do I do?
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
Go to 14:50, DialogueBaseClass.cs and replace Input.GetMouseButton(0) with Input.GetKeyDown(KeyCode.Space)
@UpBeeGames
@UpBeeGames 3 года назад
@@PandemoniumGameDev thanks man
@MahmudShuaib
@MahmudShuaib 3 года назад
Subbed!!!! Subscribed!!!!! Damn
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
Thanks my man :D
@themaskkid2677
@themaskkid2677 Год назад
My texthoulder variable is NULL, how can I fix this
@Jeea84
@Jeea84 Год назад
eh... it didn't work! dialog base class and already I'm stuck.... It's giving me a null exception. what??
@UpBeeGames
@UpBeeGames 3 года назад
Hello, I'm at 05:26 and I can't go ahead because the script has an error saying: Assets \ scripts \ Dialogo 2 \ DialogueLine.cs (21,28): error CS0103: The name 'WriteText' does not exist in the current context. I really need your help, and I'm on Unity 2019.2.0f1
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
check the DialogueBaseClass and see if you have the WriteText Ienumerator there. Check the name and make sure it's marked as protected, not private. Also check if DialogueLine class is inheriting from DialogueBaseClass not MonoBehaviour
@UpBeeGames
@UpBeeGames 3 года назад
@@PandemoniumGameDev Thanks, man, what went wrong is that I switched DialogueBaseClass to MonoBehaviour, on DialogueLine
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
@@UpBeeGames yep, no inheritance, no access to WriteText. Glad you found it.
@t.o.pgaming3188
@t.o.pgaming3188 3 года назад
Um, hopefully someone can help me with this but, WriteText int he bottom line keeps being underlined by red and I can't fix it any comments?
@t.o.pgaming3188
@t.o.pgaming3188 3 года назад
It just fixed itself nevermind.
@sudahi51
@sudahi51 4 года назад
Awesome tutorial! Quick question, do you know how you could insert a standalone sound effects between dialogue lines? Like after the player mouse clicks past a line of dialogue an effect like a glass break or something plays before the next text line reads?
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
Sure, you can do that easily. Notice the line I added after Input.GetMouseButton(0), that's the one you need, you'll also need to replace "_newSound" that I added in there, you'll figure it out, good luck :) public class DialogueBaseClass : MonoBehaviour { public bool finished { get; private set; } protected IEnumerator WriteText(string input, Text textHolder, Color textColor, Font textFont, float delay, AudioClip sound, float delayBetweenLines) { textHolder.color = textColor; textHolder.font = textFont; for (int i = 0; i < input.Length; i++) { textHolder.text += input[i]; SoundManager.instance.PlaySound(sound); yield return new WaitForSeconds(delay); } //yield return new WaitForSeconds(delayBetweenLines); yield return new WaitUntil(() => Input.GetMouseButton(0)); SoundManager.instance.PlaySound(_newSound); //Sound that plays between lines, you need to replace _newSound with an Audioclip finished = true; } }
@sudahi51
@sudahi51 4 года назад
@@PandemoniumGameDev Awesome that worked! Last question, haha. Do you know if I can add the ability to change text color, font, or facing (bold, italic, underline) of individual strings in the text?
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
@@sudahi51 harder to do with this system, will think about it but for now I'd recommend to put this stuff in a different line.
@inxendere
@inxendere 3 года назад
@@PandemoniumGameDev this absolute chad took out the time to paste the code for a confused commenter. sub earned
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
@@inxendere thanks :D I try to do it on all my videos
@teo999
@teo999 4 года назад
Eres muy bueno, crack ;b
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
muchas gracias :D
@teovallalta6967
@teovallalta6967 4 года назад
xd
@suni8
@suni8 2 года назад
You guys might get an issue at 3:25 where the INPUT text does not register at the Dialogue1. Just don't use TextMeshPro and use the text on the legacy options of the UI. For some reason, textmeshpro sux so much.
@nya2286
@nya2286 2 года назад
3:27 i followed all the code and steps but the Example Text didn't appear when I went into playmode. do you know why?
@Nt249
@Nt249 2 года назад
This is an excellent tutorial. But I have an issue, when I added text color and text font, I get 3 errors, "No overload method for WriteText takes 4 arguments" "The name textColor does not exist in the current context" "The name textFont does not exist in the current context" I'm pretty new to Unity and I'm not exactly the best at C#, so I was wondering if there was something wrong that would have caused this. My code is exact (im pretty sure) to what is in your video, but these errors come up anyway. Is there something I may have done incorrectly to cause these?
@stormy2049
@stormy2049 Год назад
For the the font and color not existing it just means that you forgot to reference them, after the line '' private Text textHolder; " Add the two following lines lines : [SerializeField] private Font textFont; [SerializeField] private Color textColor;
@mouth430
@mouth430 4 года назад
Hi, thx for this tutorial!) Its very helps me a lot) And not only for me! Pls continue your tutorials, they are so good and awful. And be so slower)
@erisvideo
@erisvideo 2 года назад
Thanks!
@afshinjavani6434
@afshinjavani6434 2 года назад
thank you
@user-qz9lo5yc9f
@user-qz9lo5yc9f Год назад
Why is it not the same to have everything in the same script?
@AllyMountfort
@AllyMountfort 3 года назад
random but I'm gonna have to watch this on my TV. My monitor doesn't fit two tabs at the same time lol
@enigmatic3280
@enigmatic3280 3 года назад
It says this when i try to make multiple lines of dialogue Assets\C#\DialogueHolder.cs(22,96): error CS1061: 'DialogueLine' does not contain a definition for 'finished' and no accessible extension method 'finished' accepting a first argument of type 'DialogueLine' could be found (are you missing a using directive or an assembly reference?)
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
Did you make finished public in the DialogueBaseClass.cs?
@enigmatic3280
@enigmatic3280 3 года назад
@@PandemoniumGameDev it was public already so i'm not sure what the problem is
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
@@enigmatic3280 also check it DialogueLine.cs is inheriting from DialogueBaseClass.cs. Otherwise not sure, you may need to go through all the code again or download the complete project from the link in the description
@DidoeS
@DidoeS 3 года назад
How to trigger it on action? When I try it stucks to the first letter...
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
I assume you're trying to say that is shows the first letter then it stops. It must be an error in this case, check your console and check the code.
@TheCreeCee
@TheCreeCee 3 года назад
Hey, first of all, thank you very much for this tutorial, its awesome! Im new to Unity, I'm a media science student from germany and we are programming our first game, so this video really helps! I dont know if you'll read this and if you can help me out, but I do have a question. I get a nullreferenceexception error with this line "SoundManager.instance.PlaySound(sound);" even though the sound plays perfectly. I would be really happy if you could help me out! And thanks again!
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
The fact that the sound plays perfectly means this exception is happening only once I assume. I think you're trying to start the dialogue in the Awake() method in some script. If that's the case change the Awake() to Start(). The problem is that the SoundManager.instance is being created in Awake, and you're trying to access it in another Awake and it's not ready. Let me know if that's the case.
@amitesh5470
@amitesh5470 Год назад
@@PandemoniumGameDev I was stuck with this problem for 2 hours. Thanks for the help!
@alok8744
@alok8744 2 года назад
I Am Getting "No Overload for method Writetext takes 6 arguments" issue
@vensentlion4944
@vensentlion4944 2 года назад
what kind of music is playing in the background?
@PandemoniumGameDev
@PandemoniumGameDev 2 года назад
Underbelly - Bodega
@masterlewzilla2116
@masterlewzilla2116 3 года назад
You are my hero
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
I'm honored to hear that :D
@masterlewzilla2116
@masterlewzilla2116 3 года назад
@@PandemoniumGameDev Do you know where in the code i can increase the size of the textfield? [TextArea(3, 10)]
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
@@masterlewzilla2116 you can adjust it directly from Unity, no need to code that
@masterlewzilla2116
@masterlewzilla2116 3 года назад
@@PandemoniumGameDev I could not find it :X also is there a way to load the input text from a text file?
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
@@masterlewzilla2116 Yes definitely, thought it will take a bit of work. Take a look at this: docs.microsoft.com/en-us/dotnet/csharp/programming-guide/file-system/how-to-read-from-a-text-file
@shinobuchiaki6129
@shinobuchiaki6129 2 года назад
Hi, awesome video! But I seem to have a problem at 13:16. When you play yours, dialogue 1 and dialogue 2 are separate but for me, the dialogues play at the same time. Hopefully you see my comment and help me with this problem. :(
@jibyap7790
@jibyap7790 2 года назад
Hey i don't know if you've figured it out, but i had the same problem. And the problem was no putting the DialogueHolder Script to the Dialogue holder object. Yeehaw
@snaggytoothy
@snaggytoothy Год назад
@@jibyap7790 Thank you! You saved my life.
@MistyWings
@MistyWings Год назад
The way you solve it is by attaching the DialogueHolder script to the text box UI!
@Redhorn01
@Redhorn01 11 месяцев назад
@@jibyap7790 bro you just saved my entire project thanks so much
@christophera434
@christophera434 3 года назад
For the first part 0-0:06 seconds is that just a black background, with changing pictures and your dialogue? How did you get the pictures to go in order and fade out/in?
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
That's not a part of this project, it's a cutscene from Undertale. You could make it tweaking this system though, just need add the image to each dialogue line, and to create the fade effect you can use a CanvasGroup component.
@christophera434
@christophera434 3 года назад
@@PandemoniumGameDev Do you do paid 1 on 1 sessions?
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
@@christophera434 never thought about this. DM me on discord
@hoaxsnowden5009
@hoaxsnowden5009 3 года назад
Why my DialogueHolder.cs is not working? It doesnt proceed to the next child of the DialogueHolder, just the first one? Thanks
@mudstonemass
@mudstonemass 3 года назад
Same issue, im trying to figure it out. If i do ill tell you the solution
@hoaxsnowden5009
@hoaxsnowden5009 3 года назад
@@mudstonemass i fixed it, im using the wrong gameobject with the dialogue holder
@abdallaelawad2009
@abdallaelawad2009 2 года назад
at 13.15 the two texts appear at the same time, I have already tried to check the scripts and settings and everything is OK. Does anyone have any idea what the problem is?
@alok8744
@alok8744 2 года назад
yes i also have same problem did you find the solution yet
@MistyWings
@MistyWings Год назад
The way you solve it is by attaching the DialogueHolder script to the text box UI!
@goldand_fr
@goldand_fr 2 года назад
its working with textmeshpro?
@StigDesign
@StigDesign 4 года назад
Really good tutorial :D Well explained and showing :) this is simular to what i need for my game :) am thinking on a DeltaForce inspired game and DF1&DF2 both had text like that with smal delay between each Letter and you hear a military type wrighter Sound :D idea of tutorial: do you know how to make a Track selection screen simular to the older ones in arcade selecting a car you had a car in senter and arrow on each side, and you select the cars via arrow keys(or on pc clikcing on the arrows or using arrows), and simular on track that shows image of track& info text on track and 2 arrows, the image and info change for each track. amd strugeling with his in my car game, and am not sure how to code it good/working without alott of IF Statements& i kind of struggle with communicating between scripts :)
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
Hey Stig, thanks a lot, really appreciate it! Regarding your idea, yeah I could make something like that for you by the end of this week, stay tuned ;) PS: don't worry that you have a lot of IF/ELSE statements for now, it's a part of the learning process, just make your game work and continue to improve gradually :) we all start out as beginners
@StigDesign
@StigDesign 4 года назад
@@PandemoniumGameDev Great :D Awsome :D oh ok hehe, That`s true, some times i have read my old code and improved it sort of hehe, few days ago i actually fixed&improved my sniper/scope script :)
@kittyherobrine
@kittyherobrine 3 года назад
How come when I get to step "Adding Custom Color and Font for each dialogue line" the text input isn't visible when I press play?
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
Make sure the color is correct, if you have black text on black background it might not be visible. That's just a guess if that's not it let me know
@kittyherobrine
@kittyherobrine 3 года назад
@@PandemoniumGameDev Yeah my colors are correct and the text is just not appearing. When I'm selected on the "Text" icon I can still see the script loading each letter one by one, but it doesn't appear in the actual game.
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
@@kittyherobrine might be that the text is not fitting in your text box, hop on to Discord and send me a video and I'll tell you for sure
@kittyherobrine
@kittyherobrine 3 года назад
@@PandemoniumGameDev Sent it
@tyrussell3516
@tyrussell3516 3 года назад
im having the same problem
@MertAliBarlas
@MertAliBarlas 3 года назад
Hello, sorry for bothering but my audio is just playing once. It's inside for loop. what should i do ?
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
Late reply, sorry about that. Are you getting any errors?
@MertAliBarlas
@MertAliBarlas 3 года назад
@@PandemoniumGameDev I fixed it but thanks for reply anyway :)
@flekiblue444
@flekiblue444 3 года назад
I was stuck at the exact same problem. After I also got stuck with the color part not showing any text, and the solution being that oppacity was 0 by standart, I expected my mistake to be something similiar this time too... I solved it by adding an audio Listener to the scene....
@MertAliBarlas
@MertAliBarlas 3 года назад
@@flekiblue444 I solved by writing my own audio manager.
@fromoldcity
@fromoldcity 3 года назад
Hey Mate. Firstly you changing lines bu using WaitForSeconds method; Secondly you use WaitUntil method with mouse click. I want to use them both. But How? I cant work with OR between WaitForSeconds and WaitUntil. Little help would be nice...Thank you.
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
You're trying to do something like this: if mouse is clicked skip the line, otherwise if player waits X seconds skip the line automatically?
@fromoldcity
@fromoldcity 3 года назад
@@PandemoniumGameDev Exactly. I trying to do that.
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
​@@fromoldcity this is not very elegant but it works: if(Input.GetMouseButton(0)) yield return new WaitUntil(() => Input.GetMouseButton(0)); else yield return new WaitForSeconds(2); finished = true;
@fromoldcity
@fromoldcity 3 года назад
@@PandemoniumGameDev I Used your new code for my game. Only one problem left that i'm faced. In this method; if I dont click mouse button, all 4 dialogue lines passed and finished nicely by order of 2 seconds row. İf I hit mouse button when the dialogue is playing, Dialog speeds up and code is stopped. The problem is; dialog is stopped. This is not passing to other dialog lines. Is there a solution for this. Thank you. ( In addition to reason that i want to do that : My game is rapid and sometimes i cannot hit the mouse button for pass the dialog.
@Cakestarr
@Cakestarr 3 года назад
whenever i add the component it doesnt say that i can add an input i did the line script it still didnt work can you tell me what the problem is?
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
need more info to help you. Which component? The DialogueLine.cs? And are you getting any errors?
@Cakestarr
@Cakestarr 3 года назад
@@PandemoniumGameDev dont think i have any errors but ill try to find some if i do
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
@@Cakestarr alright, you can DM me on discord to solve this faster
@aooosia
@aooosia 3 года назад
At 12:48 dialogueSequence returns an error saying that it can't convert system.ienumerator to string. Do you know what could be the problem? Otherwise this video has been really useful :)
@aooosia
@aooosia 3 года назад
Here's the code: using UnityEngine; using System.Collections; namespace DialogueSystem { public class DialogueHolder : MonoBehaviour { private void Awake() { StartCoroutine(dialogueSequence()); } private IEnumerable dialogueSequence() { for (int i = 0; i < transform.childCount; i++) { Deactivate(); transform.GetChild(i).gameObject.SetActive(true); yield return new WaitUntil(()=>transform.GetChild(i).GetComponent().finished); } } private void Deactivate() { for (int i = 0; i < transform.childCount; i++) { transform.GetChild(i).gameObject.SetActive(false); } } } }
@aooosia
@aooosia 3 года назад
nvm I found the mistake, i wrote ienumerable instead of ienumerator ;)
@manoyal
@manoyal 3 года назад
I am stuck after "Making multiple lines appear in sequence", In Dialogue Holder.cs, I did everything same as yours, but in this coroutine private IEnumerator dialogueSequence() { for (int i = 0; i < transform.childCount; i++) { Deactivate(); transform.GetChild(i).gameObject.SetActive(true); yield return new WaitUntil(() => transform.GetChild(i).GetComponent().finished ); //In this line unity says Null reference exception... its not going to dialogue 2 } } Also, the first letter of my input text is duplicating .... Eg: If i want to show "I am hero :D", it displays "II am hero :D"
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
Check if your dialogue holder in Unity doesn't have any other stuff except dialogue lines. You should only have dialogue lines there, otherwise it's searching for a dialogue line component and can't find it therefore the null reference.
@manoyal
@manoyal 3 года назад
@@PandemoniumGameDev NVM NVM NVM :DD I fixed all the problems, thanks for your help :D, sorry I deleted all those spam replies lol
@dingusproductions3708
@dingusproductions3708 2 года назад
My dialogue lines get played at the same time. I have no clue how to fix it. I've triple checked all lines. Everything is as in the video. Plz help
@dingusproductions3708
@dingusproductions3708 2 года назад
I've literally incorporated your unity package of the finished project and it's still doing it. Man :/...
@vladkanunnikov1443
@vladkanunnikov1443 2 года назад
You needed to move the DialogueHolder code you just wrote to the background for the text, which is also called DialogueHolder in the video.
@ploushie
@ploushie 2 года назад
At 13:16 Yours plays Dialogue 1 then Dialogue 2. For me it plays them both at the same time and I dont know what to do to fix it
@aceking1266
@aceking1266 2 года назад
i have the same problem. have you found an answer
@ploushie
@ploushie 2 года назад
@@aceking1266 Nope
@abdallaelawad2009
@abdallaelawad2009 2 года назад
@@aceking1266 @Ploushie Hi, I have exactly this problem too and I can't solve it, has anyone succeeded?
@alok8744
@alok8744 2 года назад
Check if you started couroutine for dailoguesequence
@zudla9959
@zudla9959 2 года назад
@@alok8744 what do u mean
@annoyingGnome
@annoyingGnome 2 года назад
It is strange but after making feature with custom color and font in my game, the dialogue stopped showing text to the player
@PandemoniumGameDev
@PandemoniumGameDev 2 года назад
The text has 0 opacity so it's transparent, make sure to change the color and increase opacity.
@annoyingGnome
@annoyingGnome 2 года назад
​@@PandemoniumGameDevHi, thanks for your response. But I cant find how to increase opacity. When i remove feature with custom color from code, it starts working. Then I've made a line textHolder.color=Color.black in Awake() section and it did everything right. Could you please say where is opacity option in unity? I've searched the net but didn't found info about it
@PandemoniumGameDev
@PandemoniumGameDev 2 года назад
@@annoyingGnome press on the color, and it's the fourth slider on it, you RGB and the fourth is A so opacity
@annoyingGnome
@annoyingGnome 2 года назад
@@PandemoniumGameDev thank you very much! I really appreciate you. Very helpful tutorial!
@nokostunes
@nokostunes 2 года назад
if anyone else has the problem of the sound only playing once at the start of the text, enable an audio listener for the main camera!
@KlingStudios
@KlingStudios Год назад
Thanks for this, was really scratching my head to no end over it.
@wutbuffe4734
@wutbuffe4734 4 года назад
in this function: yield return new WaitUntil(()
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
Yeah that's because the sign is => not
@wutbuffe4734
@wutbuffe4734 4 года назад
@@PandemoniumGameDev thank you :D
@wutbuffe4734
@wutbuffe4734 4 года назад
how do i make it so an event plays right after the last dialouge box is finished?
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
@@wutbuffe4734 put it in the DialogueHolder.cs: private IEnumerator dialogueSequence() { if (!dialogueFinished) { for (int i = 0; i < transform.childCount - 1; i++) { DeactivateLines(); transform.GetChild(i).gameObject.SetActive(true); yield return new WaitUntil(() => transform.GetChild(i).GetComponent().finished); } } else { DeactivateLines(); int index = transform.childCount - 1; transform.GetChild(index).gameObject.SetActive(true); yield return new WaitUntil(() => transform.GetChild(index).GetComponent().finished); } gameObject.SetActive(false); dialogueFinished = true; //put your event here! }
@wutbuffe4734
@wutbuffe4734 4 года назад
@@PandemoniumGameDev thanks this helped so much!
@Frisk_VRC
@Frisk_VRC 4 года назад
trying this and have canvas, background/dialogue , Text .... added in dialogue line and with input " Sans " as soon as i hit play and it starts ... and then pauses with only "S" in the Text....with error NullReferenceException: Object reference not set to an instance of an object DialogueSystem.DialogueBaseClass+d__4.MoveNext () (at Assets/Dialog System/Scripts/DialogueSystem/DialogueBaseClass.cs:19) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17) UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) DialogueSystem.DialogueLine:Start() (at Assets/Dialog System/Scripts/DialogueSystem/DialogueLine.cs:38) using Unity version 2018.4.20f1
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
The exception is on line 19 of DialogueBaseClass.cs so 2 options: 1. Soundmanager instance is missing 2. textHolder is missing. But from what you said that S appears then it stops it seems like you have a problem with the SoundManager, check if you create an instance of it inside Awake() or if the object is present in the scene at all.
@user-or3ze7kl5d
@user-or3ze7kl5d 3 года назад
Try in DialogueLine get "StartCoroutine..." from Awake() and put it to Update() and add IF statement to it (for example: if you push SPACE, then dialog will start). I have same problem. And it help
@user-or3ze7kl5d
@user-or3ze7kl5d 3 года назад
Or just make in DialogueBaseClass.cs something like this: if(sound != null) { SoundManagerScr.instance.PlaySound(sound); }
@WafelqLIVE
@WafelqLIVE 4 года назад
Very good video! Can you make a tutorial how to make a Undertale Battle System?
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
Thanks! The battle system is not on my list yet, you can check out this video though: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-XjGHyKBSkX4.html
@jeongshurouq6046
@jeongshurouq6046 2 года назад
Hello I tried to solve the problem many times, but after applied 05:02 script, the letter disappears. can any1 explain me how to fix it?
@dingusproductions3708
@dingusproductions3708 2 года назад
For me, the alpha of the text was at 0. You can change it when change the color. Underneath the RGB values, you'll find Alpha values.
@jeongshurouq6046
@jeongshurouq6046 2 года назад
@@dingusproductions3708 thanks a lot, I fixed problem by this solution
@toxiconflict
@toxiconflict 4 года назад
I have a strange problem. When I manually write text in the text section in the inspector I can see the text appear on screen. But when I press play, I hear the sans sfx but I dont see any text written on the screen.
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
That's the trick here, you don't write the text into the text section, you write it in your Dialogue Line(Script) component, there's an input field there for it. Hope this helps :)
@toxiconflict
@toxiconflict 4 года назад
@@PandemoniumGameDev yeah I did that. I write it in the input section of the script and it shows it typing in my text section on the text gameobject, but I don't see it in game. Just the blank dialog box image.
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
@@toxiconflict Weird, did you make the script run in Editor Mode? If not follow the video or alternatively just download the entire project, link is in the description. Let me know how it goes :)
@edywiiii
@edywiiii 4 года назад
@@PandemoniumGameDev I'm having the exact same error. Maybe has it something to do with the DialogueLine being a DialogueBase class, instead of a Monobehaviour one?? How do you run the script in Editor Mode?
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
@@edywiiii DialogueBaseClass derives from Monobehaviour, therefore the DialogueLine class also derives from it + the DialogueBaseClass. Now it you get an error try checking the log, maybe there's something else causing it. If you still can't figure it out download the complete project(link in description), as you can see in the video it's working, tried to run it now and it works fine.
@drakoronus
@drakoronus 4 года назад
Hey! Thanks for the tutorial! I've actually figured out how to trigger the dialogue after pressing a key while in a certain place. Yet, I can't understand how can I create a system with infinitely repeating lines. I want it to work this way, but can't understand how to implement it: - Start dialogue - Text being written - End of dialogue - Start again - The same text being written again - End - Start again And on and on like this. I've tried everything out, but when I start a dialogue again it just prints the last line of dialogue and doesn't let me close it. And also, how can I make it so when I press a certain key the line prints fully, so I can skip waiting for the line to end? Please, make a video explaining this topic. I've searched all throughout the Internet and haven't found anything useful!
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
Glad to hear it helped, I've been reading all your messages and I can't wait to make another episode. Finishing one of my jobs this week and making the new episode this weekend for sure, it will include everything you wanted in the comment.
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
Meanwhile, if you need a quick solution here's what I did in a couple minutes: 1. find a way to activate/deactivate DialogueHolder object from another script. 2. use the changes I did below and it will work every time you you want to start the dialogue again //Dialogue holder using System.Collections; using UnityEngine; namespace DialogueSystem { public class DialogueHolder : MonoBehaviour { private void OnEnable() { StartCoroutine(dialogueSequence()); } private IEnumerator dialogueSequence() { for (int i = 0; i < transform.childCount; i++) { Deactivate(); transform.GetChild(i).gameObject.SetActive(true); yield return new WaitUntil(() => transform.GetChild(i).GetComponent().finished); } gameObject.SetActive(false); } private void Deactivate() { for (int i = 0; i < transform.childCount; i++) { transform.GetChild(i).gameObject.SetActive(false); transform.GetChild(i).GetComponent().ResetLine(); } } } } //DialogueBaseClass using System.Collections; using UnityEngine; using UnityEngine.UI; namespace DialogueSystem { public class DialogueBaseClass : MonoBehaviour { public bool finished { get; set; } protected IEnumerator WriteText(string input, Text textHolder, Color textColor, Font textFont, float delay, AudioClip sound, float delayBetweenLines) { textHolder.color = textColor; textHolder.font = textFont; for (int i = 0; i < input.Length; i++) { textHolder.text += input[i]; SoundManager.instance.PlaySound(sound); yield return new WaitForSeconds(delay); } //yield return new WaitForSeconds(delayBetweenLines); yield return new WaitUntil(() => Input.GetMouseButton(0)); finished = true; } } } //DialogueLine using UnityEngine; using UnityEngine.UI; namespace DialogueSystem { public class DialogueLine : DialogueBaseClass { private Text textHolder; [Header ("Text Options")] [SerializeField] private string input; [SerializeField] private Color textColor; [SerializeField] private Font textFont; [Header("Time parameters")] [SerializeField] private float delay; [SerializeField] private float delayBetweenLines; [Header("Sound")] [SerializeField] private AudioClip sound; [Header("Character Image")] [SerializeField] private Sprite characterSprite; [SerializeField] private Image imageHolder; private void Awake() { imageHolder.sprite = characterSprite; imageHolder.preserveAspect = true; ResetLine(); } public void ResetLine() { textHolder = GetComponent(); textHolder.text = ""; finished = false; } private void OnEnable() { StartCoroutine(WriteText(input, textHolder, textColor, textFont, delay, sound, delayBetweenLines)); } } }
@drakoronus
@drakoronus 4 года назад
Thank you so much! I'll try it as soon as I can! I've already found out a way to activate Dialogue Holder from the NPC's script! I think this may work if I put it together rightly. Thank you again!
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
@@drakoronus Sure, stay tuned, I see people really want to see this grow so I'll make more videos on this.
@drakoronus
@drakoronus 4 года назад
@@PandemoniumGameDev HAHAHAHA YES! IT WORKS! I just needed to put the "OnActive" function into the scripts and reset the text lines, but I didn't know how to do this before. Thank you!
@Short_coding009
@Short_coding009 3 года назад
What is different between unity hub and unitu3d
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
Unity hub is just a program that shows you all project and Unity versions that you have. An explorer of some kind that makes it easier to navigate. You still a version of Unity3D to work.
@omori8112
@omori8112 3 года назад
Hi, I have gotten to the part where you make the dialogue, but when I hit play, the text will show in the Unity text sidebar, but on the play screen, nothing shows. Can you help me? My Script //DialogueLine using UnityEngine.UI; using UnityEngine; using System.Collections; namespace DialogueSystem { public class DialogueLine : DialogueBaseClass { private Text textHolder; [Header ("Text Options")] [SerializeField]private string input; [SerializeField]private Color textColor; [SerializeField]private Font textFont; private void Awake() { textHolder = GetComponent(); StartCoroutine(WriteText(input, textHolder, textColor, textFont)); } } } //DialogueBaseClass using UnityEngine.UI; using UnityEngine; using System.Collections; namespace DialogueSystem { public class DialogueBaseClass : MonoBehaviour { protected IEnumerator WriteText(string input, Text textHolder, Color textColor, Font textFont) { textHolder.color = textColor; textHolder.font = textFont; for (int i = 0; i < input.Length; i++) { textHolder.text += input[i]; yield return new WaitForSeconds(0.1f); } } } }
@jessicaengstler6667
@jessicaengstler6667 3 года назад
Same Problem. Do you have the answer yet?
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
the code is correct, can you check if you attached the script to the Text object like at 3:23?
@omori8112
@omori8112 3 года назад
@@PandemoniumGameDev It still doesn't display the text. If you have discord, I can send you a clip of the code running. My discord name is Howie Nation#9225
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
@@omori8112 sent you a request
@xsuerror2689
@xsuerror2689 3 года назад
та же проблема, что делать?
@RayanmoZa
@RayanmoZa 3 года назад
NullReferenceException: Object reference not set to an instance of an object DialogueSystem.DialogBaseClass+d__0.MoveNext () (at Assets/Scripts/DialogBaseClass.cs:13) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at :0) UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) DialogueSystem.DialogLine:Awake() (at Assets/Scripts/DialogLine.cs:24) Error
@s0ulf1y
@s0ulf1y 6 месяцев назад
did you solved it
@isabelebenevinuto2637
@isabelebenevinuto2637 4 года назад
Great tutorial! How can I make it work with TextMesh Pro instead of Text?
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
Pretty small change, the textHolder variable has to be of type TextMeshPro not text, the rest of the logic stays the same basically
@isabelebenevinuto2637
@isabelebenevinuto2637 4 года назад
@@PandemoniumGameDev I can't because it's always trying to convert TMP to Unity default text. I tried "TextMeshPro.SetText" instead of "WriteText" but it doesn't work
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
@@isabelebenevinuto2637 WriteText is not a preset function, it's one I made, that's why TextMesh doesn't have it built it. Instead what you want to do is this: public class DialogueBaseClass : MonoBehaviour { public bool finished { get; set; } protected IEnumerator WriteText(string input, TextMeshPro textHolder, Color textColor, TMP_FontAsset textFont, float delay, AudioClip sound, float delayBetweenLines) { textHolder.color = textColor; textHolder.font = textFont; for (int i = 0; i < input.Length; i++) { textHolder.text += input[i]; SoundManager.instance.PlaySound(sound); yield return new WaitForSeconds(delay); } yield return new WaitUntil(() => Input.GetMouseButton(0)); finished = true; } } Notice that the logic is the same but I replaced Text with TextMeshPro and Font with TMP_FontAsset, it will work now if you everything else right. Good luck! :)
@isabelebenevinuto2637
@isabelebenevinuto2637 4 года назад
​@@PandemoniumGameDev Thank you! I appreciate your help and patience. I was doing something like that before but realized it wasn't working because I was modifying it in a different script and forgot to change the class name. Now there aren't any errors in the scripts, but when I press play and activate the dialogue, I got some NullReferenceException errors: DialogueSystem.DialogueLineTMP.ResetLine () DialogueSystem.DialogueLineTMP.Awake () UnityEngine.GameObject:SetActive(Boolean) DialogueSystem.DialogueLineTMP.ResetLine () DialogueSystem.DialogueHolderTMP.Deactivate () DialogueSystem.DialogueHolderTMP+d__1.MoveNext () UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at :0) UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) DialogueSystem.DialogueHolderTMP:OnEnable() my DialogueLineTMP and DialogueHolderTMP code: using System.Collections; using UnityEngine; using UnityEngine.UI; using TMPro; namespace DialogueSystem { public class DialogueLineTMP : DialogueBaseClassTMP { private TextMeshPro textHolder; [Header("Texto")] [SerializeField] private string input; [SerializeField] private Color textColor; [SerializeField] private TMP_FontAsset textFont; [Header("Delay")] [SerializeField] private float delay; [Header("Icon")] [SerializeField] private Sprite characterSprite; [SerializeField] private Image imageHolder; private IEnumerator lineShow; private void Awake() { imageHolder.sprite = characterSprite; imageHolder.preserveAspect = true; ResetLine(); } public void ResetLine() { textHolder = GetComponent(); textHolder.text = ""; end = false; } private void OnEnable() { lineShow = WriteText(input, textHolder, textColor, textFont, delay); StartCoroutine(lineShow); } private void Update() { if (Input.GetMouseButtonDown(0) && lineShow != null) { if (textHolder.text != input) { textHolder.text = input; } else { end = true; } StopCoroutine(lineShow); } } } } ///////////////////// ///////////////////// using System.Collections; using UnityEngine; namespace DialogueSystem { public class DialogueHolderTMP : MonoBehaviour { private void OnEnable() { StartCoroutine(dialogueSequence()); } private IEnumerator dialogueSequence() { for (int i = 0; i < transform.childCount; i++) { Deactivate(); transform.GetChild(i).gameObject.SetActive(true); yield return new WaitUntil(() => transform.GetChild(i).GetComponent().end); } gameObject.SetActive(false); } private void Deactivate() { for (int i = 0; i < transform.childCount; i++) { transform.GetChild(i).gameObject.SetActive(false); transform.GetChild(i).GetComponent().ResetLine(); } } } } The DialogueBaseClass is pretty much the same you wrote, but the name is "DialogueBaseClassTMP", using TMPro; and without the AudioClip sound and delayBetweenLines because I won't use them. I've been trying to figure it out for hours and still don't know what is wrong...
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
@@isabelebenevinuto2637 It's hard to point it out here without screenshots. Join discord and let's see what we can do: discord.gg/eVDD5m9
@radixwashere5634
@radixwashere5634 4 года назад
Thank you so much but i am trying to do when you press a button when you near a npc, run a dialogue with this system but it is just run single dialogue and when i press a button it doesn't skip. Here is my interaction script: namespace DialogueSystem { public class interaction : MonoBehaviour { public LayerMask myLayer; public Transform myObj; public Transform player; [SerializeField] private float radius; private bool playerDetector; public dialogueHolder dialogue; void FixedUpdate() { playerDetector = Physics2D.OverlapCircle(myObj.position, radius, myLayer); if (playerDetector) { if (Input.GetKey(KeyCode.E)) { dialogue.gameObject.SetActive(true); } } } } }
@PandemoniumGameDev
@PandemoniumGameDev 4 года назад
hey man, episode 2 is all done, releasing it today, you're gonna find what you're looking for there
@radixwashere5634
@radixwashere5634 4 года назад
@@PandemoniumGameDev Alright then, thanks
@jimmyhsp
@jimmyhsp 3 года назад
gracias
@nerve7716
@nerve7716 Год назад
hey i downloaded ur unity package and i just copied and pasted the dialogue holder folder in the canvas of my scene but it didn't work any ideas on what the problem could be ?
@PandemoniumGameDev
@PandemoniumGameDev Год назад
What do you mean by didn't work? Did you get any errors or smth else?
@nerve7716
@nerve7716 Год назад
@@PandemoniumGameDev only the first letter of the text appeared
@nerve7716
@nerve7716 Год назад
Oh yes i got an error it said nullReference in dialoguebase script
@PandemoniumGameDev
@PandemoniumGameDev Год назад
@@nerve7716 OK, good start, now if you double click the error to which part of the code does it take you?
@nerve7716
@nerve7716 Год назад
@@PandemoniumGameDev hey can i post screenshots in discord or somewhere else where i can reach you ?
@enigmatic3280
@enigmatic3280 3 года назад
i keep getting this error message (i'm at the part where you add sound) NullReferenceException: Object reference not set to an instance of an object SoundManager.PlaySound (UnityEngine.AudioClip sound) (at Assets/C#/Core/SoundManager.cs:18) DialogueSystem.DialogueBaseClass+d__0.MoveNext () (at Assets/C#/DialogueBaseClass.cs:18) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at :0) UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) DialogueSystem.DialogueLine:Awake() (at Assets/C#/DialogueLine.cs:27)
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
2 options here: 1. either the SoundManager script is not assigned to the object. Check in the editor to make sure. 2. DialogueLine.cs script can't find SoundManager.instance because it's not created yet. Change Awake() to Start() in DIalogueLine.cs line 22.
@enigmatic3280
@enigmatic3280 3 года назад
@@PandemoniumGameDev i forgot to write source = GetComponent() thanks for the help
@Gochuyo
@Gochuyo Год назад
@@PandemoniumGameDev your a freaking genius to think changing awake to start() would fix it
@teear2824
@teear2824 3 года назад
Hi, does this dialogue system works on mobile as well?
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
yes, the platform doesn't matter. You'll just need to adapt the UI
@teear2824
@teear2824 3 года назад
@@PandemoniumGameDev that's amazing! Thank you so much 😊
@jibyap7790
@jibyap7790 2 года назад
Did anyone solve the dialogues appearing at the same time? ):
@MistyWings
@MistyWings Год назад
The way you solve it is by attaching the DialogueHolder script to the text box UI!
@RIVVASI
@RIVVASI 3 года назад
Yup
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
yup
@YozyXD
@YozyXD 3 года назад
Hey man, i really like ur vid. But i have a problem in here, my text doesn't show up
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
Gonna need a bit more info to help you. At which minute into the video are you? And do you have any errors?
@YozyXD
@YozyXD 3 года назад
@@PandemoniumGameDev i use your script in the description, then when i use it my character image working, but my dialogueline1 doesn't even show up
@PandemoniumGameDev
@PandemoniumGameDev 3 года назад
@@YozyXD well you're gonna have to use all the scripts and the exact structure as I did in the video. Check that the DialogueHolder is the parent object and has the DialogueHolder script. Then place multiple text objects as it's children and give them each the DialogueLine script.
@YozyXD
@YozyXD 3 года назад
@@PandemoniumGameDev ok, i will try it
Далее
Undertale DIALOGUE in Unity (Episode 2)
15:34
Просмотров 15 тыс.
The Evolution of My Game's Dialogue System
43:36
Просмотров 44 тыс.
I Made the Same Game in 8 Engines
12:34
Просмотров 4 млн
Making Dialogue with Inky and Unity Tutorial
12:16
Просмотров 50 тыс.
Creating a Flexible Dialogue System With Unity 2D
10:17
How to ACTUALLY get into Gamedev
14:01
Просмотров 705 тыс.
A new way to generate worlds (stitched WFC)
10:51
Просмотров 519 тыс.
How to make a Dialogue System with Unity
9:40
Просмотров 52 тыс.
Optimizing my Game so it Runs on a Potato
19:02
Просмотров 507 тыс.
Undertale Icebound | All Battles | Full Game - Demo
30:21
ПОЛНЫЙ РЕАЛИЗМ в UBOAT 2024.1
47:02
Просмотров 42 тыс.