Okay to start coding the functionality, let's open up our Scripts folder and open up app initialize. Okay, so I'm just gonna be in a few things up here. We'll be doing a lot of work in this script in the next few episodes. So I just want to make sure that everything is set up pretty nicely. First thing we can do is we actually write in awake application dot target frame rate, and we just equal up to 60. That will mean that it will target 60 frames per second.
So again, we'll look smooth on all devices. Then we can set a few variables. So these will be our menu. Our menus I suppose you can say so public game object in menu, UI, public game object in game, UI, and public game, object. Game Over UI. So another variable we'll need is a reference to our player.
So we can write public game object player. So now we can access our player. And we want to actually the first thing we want to do is we when we start the game, we don't want to start and just immediately start playing again, we want to start in the menu. So the first thing we want to do is actually stop the player from moving. So we do that by just saying player dot get component rigidbody dot constraints equals rigidbody constraints dot freeze position. Then all we want to do is tell the game which items which menus we want to have on and which menus we want to have off.
And the first thing we want to do is we want to turn out, we want to turn out in menu UI on. So we did it by saying in menu UI dot Game Object dot set active. And then we can just put inside parentheses. True. So what that's doing is that is making sure that that in menu UI is ticked on like that. That's what that said active represents.
And the only other thing we want to do, and this is just for, for having clean code, is we want to turn the other to make sure the other two are turned off. So we can say, in game UI, dot game object dot set, active, false. Closing semicolon, obviously, we can copy this dump underneath, and we can say, game over UI to get him to live active equals false. So now if we go back to our game, And we go to our scene manager, you see that we can fill in these three spots. So we can fill in the player. We can fill in Game Over UI, in menu UI.
And in game UI. Cool. So let's, let's press play and see what happens. Awesome. So now that what happens is all the other menus turn off, and this menu turns on. Fantastic.
That's exactly what we want. But now when we press play, well, our game doesn't do anything we can I suppose we move left and right, if we use the control sticks, well, the keyboard game doesn't actually do anything. And when we press the play button, nothing actually happens. So we'll tackle this problem in the next episode.