

This is a very simple step and only takes a few clicks.Ĭlick edit in the top right, then click on Project Settings. When you are done creating your variables make sure to compile and save! Accessing your Game Instance Configuring the Project Settingsįirstly, before you can access your game instance, you will need to configure the game to use the new Game Instance that we just created. On the left hand side click the + Variable button to add a new variable.įor this example I have created a Float variable called Health that has a default value of 100. Adding Variablesįirstly, to add variables to your new Game Instance, simply double click to open the blueprint editor. Now after naming your new Game Instance, it will be shown in the content browser. In the search box type Game Instance, click the GameInstance text and then click select to create our new Game Instance. To create the Game Instance class we need to click the ‘All Classes’ drop down at the bottom.Ĭlicking this will now show all the classes we can create.

To create the Game Instance class, right click anywhere in your content browser at the bottom and click ‘Blueprint Class’.Ī new dialog box will show and ask which parent class you wish to make. Once you close your game the data is lost! Creating your Game Instance Creating the Class The data is kept as long as the game is running. This means data such as player health, score, ammo and more can be stored between levels. The game instance is a manager class that is not destroyed when changing levels in your game. 4.1 More Complex Uses What is the Game Instance
