 Today I'm going to be covering how to add a dialogue and how to pause your game to prevent any player input. So we have our game here and it's very simple movement, doesn't have anything fancy, same as with the other tutorial and if you want to check it out how to make it you can follow the description here. And now I wanted that whenever I move the character into a position and I press a key, a dialogue shows up at the bottom and I cannot keep moving so I make sure that the player reads whatever is there and then they can continue playing. So to do that I will first create here on project, project settings, the interact key. We're going to be using action interact, I'll be using the key E which is a pretty common one to use, especially if your player moves with the WASD. So now we need to make the dialogue show up whenever we press the letter E. Here in the code this is the script version, not the visual scripting version but it's super simple. We can add if input is action just pressed, interact so this will happen whenever we press interact. We're going to be loading our dialogue, let's load it here and we load it, dialogue is here under scenes, dialogue box. I did this one on the first dialogue tutorial, if you want to check it out you can find a link in the description or on the card at the top. So now that we have the dialogue we need to create an instance of it, it's called dialogue node, instant. So that creates it. We will also like to move it to the center because if we add it right now it's going to be at zero and I calculated before that the position that we need is a little bit on the middle of the screen, it's the recognition 152 and 332. This should be a good position for the dialogue to show up. Now since we're on the player we want to add it to the parent, in this case the game node, so it's not a child of this and you cannot move it around, so in this case we get the parent and now that is our dialogue. So let's see how it works right now, I'm going to save it, I'm going to play it, I can move around and when I press the interact key I see why this dialogue shows up, the game should be paused, but it is not paused because I can still move. So we need to fix that and Godot has an inbuilt way of pausing things which is by getting the tree and the paused variable equal to true and that's it, your game will pause, nothing will move and if we try it out it's true, like we tried and we created and now I cannot move, I cannot do anything and that's a problem in this case because we really want the dialogue to move. So if you notice whenever you select a node you can set the pause mode, in this case the mode is inherit, that means that whenever the tree is paused on true all its childs will pause as well, if you want to skip this, if you want to make that something can keep moving while you're on pause you can change the mode to process, that means that the process function will keep going on even if the tree is on pause, if you press stop it will stop moving whenever you are on pause and if you press inherit it will check the state of the parent, in this case a tree, if it's the player it will check it on the game, the game will check it on the tree. So we want to change the mode of that node, how do we do that, well we go to our scene, our dialogue box and here in pause we change it instead of from inherit to process and we save. Now let's play this again so I can move and when I press the interact key the dialogue shows up and I cannot move even if I press all the keys the player is paused so now when I press enter to finish the dialogue I'm still frozen there because I forgot to tell the game okay you can resume now. So let's add that at the end of the dialogue, whenever the dialogue ends let's resume the game, so let's go to the dialogue box and here in the script let's search here Q3 this is when the dialogue ends get tree paused equal to pause so we are not pausing anymore and we make sure that whenever the dialogue ends and this deletes itself it will also resume the game so let's try it out again let's go to dialogue opens I cannot keep moving everything is freezing and then when the dialogue ends I can move again and I can open the dialogue again. So this covers a lot of the questions that you guys ask me like how do you act the dialogue me game or how can I make the game to pause while I'm doing this and this is a super straightforward thing super simple to do just remember if you want things to keep moving you need to specify it on the dialogue and on the pause section here in the inspector so stop it will stop process it will keep moving even if everything's paused and inherit you will take the state from its parent so that's it for today and I hope you like this tutorial if you want to support me you can do so on patreon I really like to thank all of you and hope to guys see you in my discord server Twitter or here in the comments if you have any questions or you need anything please remember to subscribe like and all those things thank you and bye