I'm making a game that has NPC's in it that can talk to the player.
What I have coded is that when the player in overlapping the NPC and presses a key, a dialogue box pops up with some typewriter text.
Now if the user wants to skip the typewriter text, they press the key which will then finish the text.
Now the text that is finished will stay visible until the player presses the key again, this time the dialogue box disappears with the text.
The only problem being that the dialogue box just disappears after the first time the key is pressed instead of finishing the text and waiting for another key press to close the dialogue box.
Now I also have a code that says if the player lets the text run and when the text is finished, if the key is pressed it will close the dialogue box.
To me this seems like a really easy thing to code, but I can't figure out what is going wrong. I made a test project to find out the answer before applying it my my real one.