PlayerDialogue -City Scene


My partner gave me new dialogues which I had to adapt to the City scene. These dialogues appear as soon as you start the city scene, right after the introduction (tunnel scene) to continue with a narrative line, but in addition, these new dialogues will serve to give a clue to the player of what to do next, because information is given of where he has to go.

This was easy to achieve since they are linear dialogues and have no answer options, but to make it more dynamic and cute, I wanted to add an Animal Crossing-like animation to the text, in which it appears letter by letter. For this I created a new script called TypeWritterEffetc, in which to animate the text letter by letter I used an IEnumerator, which calls the text (this is a public variable to assign it in the inspector, you have to write here the text you want to animate) and calls letter by letter: it calls the first letter, waits the seconds indicated by the speed variable, and repeats the process calling the next letter. Also, as a particular effect, I made the “next” button appear only after the text animation is finished, so there is no chance of clicking it before you can finish reading. Also, I added an option where if you click it before the animation finishes, the whole text is played at once for people who don't like to wait to read. It is also important to mention that as these dialogues will be spoken by the character, the character's sprite is reflected next to the text, but it is shown according to the character identity you have chosen in the introduction. I did this by duplicating the CharacterIDManager script, in which I only changed that the resource instead of being a SpriteRenderer to call the corresponding sprite of the characterIndex, was an image so that it could be visible from the canvas. This way, the character you have chosen is shown next to the text.




Along with this, as they were linear dialogs, I wanted it to be a single interface with the same button and the same text box so I didn't have to make different interfaces and thus save optimization for the game. So, I created another script in which the text animation script is called, but this new script called AutoDialogo, contains a list in which I put all the dialogs. As soon as you press the continue button in a dialog, the next dialog is played in order with the same text animation effect and button conditions. This pattern repeats until the dialogs are finished and the interface is disabled. This is very useful as I only had to use a single interface panel, button and text box for all dialogs.

Leave a comment

Log in with itch.io to leave a comment.