<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>saving over levels Archives - Couch Learn</title>
	<atom:link href="https://couchlearn.com/tag/saving-over-levels/feed/" rel="self" type="application/rss+xml" />
	<link>https://couchlearn.com/tag/saving-over-levels/</link>
	<description>Detailed Game Programming Tutorials</description>
	<lastBuildDate>Sat, 25 Jan 2025 17:34:27 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.5</generator>

<image>
	<url>https://couchlearn.com/wp-content/uploads/2020/05/cropped-logolarge-32x32.png</url>
	<title>saving over levels Archives - Couch Learn</title>
	<link>https://couchlearn.com/tag/saving-over-levels/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to use the Game Instance in Unreal Engine 4</title>
		<link>https://couchlearn.com/how-to-use-the-game-instance-in-unreal-engine-4/</link>
					<comments>https://couchlearn.com/how-to-use-the-game-instance-in-unreal-engine-4/#respond</comments>
		
		<dc:creator><![CDATA[Matt]]></dc:creator>
		<pubDate>Thu, 10 Oct 2019 16:21:42 +0000</pubDate>
				<category><![CDATA[Easy Difficulty]]></category>
		<category><![CDATA[UE4 Basics]]></category>
		<category><![CDATA[Unreal Basics]]></category>
		<category><![CDATA[Unreal Engine]]></category>
		<category><![CDATA[game instance]]></category>
		<category><![CDATA[player values]]></category>
		<category><![CDATA[saving over levels]]></category>
		<category><![CDATA[ue4]]></category>
		<category><![CDATA[ue4 game instance]]></category>
		<category><![CDATA[unreal engine]]></category>
		<category><![CDATA[unreal engine 4]]></category>
		<category><![CDATA[unreal engine 4 game instance]]></category>
		<guid isPermaLink="false">https://couchlearn.com/?p=775</guid>

					<description><![CDATA[<p>The Game Instance is one the most important blueprint classes in an Unreal Engine 4 game. In this guide we will go through what the <a class="mh-excerpt-more" href="https://couchlearn.com/how-to-use-the-game-instance-in-unreal-engine-4/" title="How to use the Game Instance in Unreal Engine 4">[...]</a></p>
<p>The post <a href="https://couchlearn.com/how-to-use-the-game-instance-in-unreal-engine-4/">How to use the Game Instance in Unreal Engine 4</a> appeared first on <a href="https://couchlearn.com">Couch Learn</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>The Game Instance is one the most important blueprint classes in an Unreal Engine 4 game. <br><br>In this guide we will go through what the Game Instance does and how to use the game instance in Unreal Engine 4.</p>



<figure class="wp-block-image"><img decoding="async" width="559" height="69" src="https://couchlearn.com/wp-content/uploads/2019/10/image-10.png" alt="game instance project settings value" class="wp-image-825" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-10.png 559w, https://couchlearn.com/wp-content/uploads/2019/10/image-10-416x51.png 416w, https://couchlearn.com/wp-content/uploads/2019/10/image-10-300x37.png 300w" sizes="(max-width: 559px) 100vw, 559px" /></figure>



<h3 class="wp-block-heading">What is the Game Instance</h3>



<p class="has-text-align-left">The game instance is a manager class that is not destroyed when changing levels in your game.<br><br>This means data such as player health, score, ammo and more can be stored between levels.</p>



<p class="has-text-align-center"><strong>The data is kept as long as the game is running.</strong><br><strong>Once you close your game the data is lost!</strong></p>



<figure class="wp-block-image"><img fetchpriority="high" decoding="async" width="658" height="195" src="https://couchlearn.com/wp-content/uploads/2019/10/image-16.png" alt="Casting to the game instance created later in the guide" class="wp-image-832" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-16.png 658w, https://couchlearn.com/wp-content/uploads/2019/10/image-16-416x123.png 416w, https://couchlearn.com/wp-content/uploads/2019/10/image-16-300x89.png 300w" sizes="(max-width: 658px) 100vw, 658px" /></figure>



<h3 class="wp-block-heading">Creating your Game Instance</h3>



<h4 class="wp-block-heading">Creating the Class</h4>



<p>To create the Game Instance class, right click anywhere in your content browser at the bottom and click &#8216;Blueprint Class&#8217;.</p>



<figure class="wp-block-image"><img decoding="async" width="1024" height="650" src="https://couchlearn.com/wp-content/uploads/2019/10/image-1024x650.png" alt="Creating a new blueprint class" class="wp-image-815" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-1024x650.png 1024w, https://couchlearn.com/wp-content/uploads/2019/10/image-416x264.png 416w, https://couchlearn.com/wp-content/uploads/2019/10/image-300x191.png 300w, https://couchlearn.com/wp-content/uploads/2019/10/image-768x488.png 768w, https://couchlearn.com/wp-content/uploads/2019/10/image.png 1359w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>A new dialog box will show and ask which parent class you wish to make.</p>



<figure class="wp-block-image"><img decoding="async" width="544" height="442" src="https://couchlearn.com/wp-content/uploads/2019/10/image-1.png" alt="List of blueprint classes to potentially create" class="wp-image-816" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-1.png 544w, https://couchlearn.com/wp-content/uploads/2019/10/image-1-416x338.png 416w, https://couchlearn.com/wp-content/uploads/2019/10/image-1-300x244.png 300w" sizes="(max-width: 544px) 100vw, 544px" /></figure>



<p>To create the Game Instance class we need to click the &#8216;All Classes&#8217; drop down at the bottom.</p>



<figure class="wp-block-image"><img decoding="async" width="544" height="442" src="https://couchlearn.com/wp-content/uploads/2019/10/image-2.png" alt="Selecting all classes to spawn" class="wp-image-817" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-2.png 544w, https://couchlearn.com/wp-content/uploads/2019/10/image-2-416x338.png 416w, https://couchlearn.com/wp-content/uploads/2019/10/image-2-300x244.png 300w" sizes="(max-width: 544px) 100vw, 544px" /></figure>



<p>Clicking this will now show all the classes we can create.</p>



<figure class="wp-block-image"><img decoding="async" width="544" height="743" src="https://couchlearn.com/wp-content/uploads/2019/10/image-3.png" alt="Listing all blueprint classes to potentially create" class="wp-image-818" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-3.png 544w, https://couchlearn.com/wp-content/uploads/2019/10/image-3-416x568.png 416w, https://couchlearn.com/wp-content/uploads/2019/10/image-3-220x300.png 220w" sizes="(max-width: 544px) 100vw, 544px" /></figure>



<p>In the search box type Game Instance, click the GameInstance text and then click select to create our new Game Instance.</p>



<figure class="wp-block-image"><img decoding="async" width="544" height="554" src="https://couchlearn.com/wp-content/uploads/2019/10/image-4.png" alt="Selecting the game instance class to create" class="wp-image-819" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-4.png 544w, https://couchlearn.com/wp-content/uploads/2019/10/image-4-416x424.png 416w, https://couchlearn.com/wp-content/uploads/2019/10/image-4-295x300.png 295w" sizes="(max-width: 544px) 100vw, 544px" /></figure>



<p>Now after naming your new Game Instance, it will be shown in the content browser.</p>



<figure class="wp-block-image"><img decoding="async" width="331" height="191" src="https://couchlearn.com/wp-content/uploads/2019/10/image-5.png" alt="Renaming your new game instance class" class="wp-image-820" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-5.png 331w, https://couchlearn.com/wp-content/uploads/2019/10/image-5-300x173.png 300w" sizes="(max-width: 331px) 100vw, 331px" /></figure>



<h4 class="wp-block-heading">Adding Variables</h4>



<p>Firstly, to add variables to your new Game Instance, simply double click to open the blueprint editor.</p>



<figure class="wp-block-image"><img decoding="async" width="1024" height="288" src="https://couchlearn.com/wp-content/uploads/2019/10/image-6-1024x288.png" alt="Opening the game instance class" class="wp-image-821" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-6-1024x288.png 1024w, https://couchlearn.com/wp-content/uploads/2019/10/image-6-416x117.png 416w, https://couchlearn.com/wp-content/uploads/2019/10/image-6-300x84.png 300w, https://couchlearn.com/wp-content/uploads/2019/10/image-6-768x216.png 768w, https://couchlearn.com/wp-content/uploads/2019/10/image-6.png 1124w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>On the left hand side click the + Variable button to add a new variable.</p>



<figure class="wp-block-image"><img decoding="async" width="442" height="201" src="https://couchlearn.com/wp-content/uploads/2019/10/image-7.png" alt="Creating a new variable" class="wp-image-822" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-7.png 442w, https://couchlearn.com/wp-content/uploads/2019/10/image-7-416x189.png 416w, https://couchlearn.com/wp-content/uploads/2019/10/image-7-300x136.png 300w" sizes="(max-width: 442px) 100vw, 442px" /></figure>



<p>For this example I have created a Float variable called Health that has a default value of 100.</p>



<figure class="wp-block-image"><img decoding="async" width="477" height="459" src="https://couchlearn.com/wp-content/uploads/2019/10/image-8.png" alt="Creating the health variable" class="wp-image-823" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-8.png 477w, https://couchlearn.com/wp-content/uploads/2019/10/image-8-416x400.png 416w, https://couchlearn.com/wp-content/uploads/2019/10/image-8-300x289.png 300w" sizes="(max-width: 477px) 100vw, 477px" /></figure>



<p>When you are done creating your variables make sure to compile and save!</p>



<figure class="wp-block-image"><img decoding="async" width="153" height="72" src="https://couchlearn.com/wp-content/uploads/2019/10/image-9.png" alt="Compiling and saving the new changes" class="wp-image-824" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-9.png 153w, https://couchlearn.com/wp-content/uploads/2019/10/image-9-150x72.png 150w" sizes="(max-width: 153px) 100vw, 153px" /></figure>



<h3 class="wp-block-heading">Accessing your Game Instance</h3>



<h4 class="wp-block-heading">Configuring the Project Settings</h4>



<p>Firstly, before you can access your game instance, you will need to configure the game to use the new Game Instance that we just created.<br><br><strong>This is a very simple step and only takes a few clicks.</strong></p>



<p>Click edit in the top right, then click on Project Settings.</p>



<figure class="wp-block-image"><img decoding="async" width="638" height="445" src="https://couchlearn.com/wp-content/uploads/2019/10/image-11.png" alt="Opening the project settings" class="wp-image-826" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-11.png 638w, https://couchlearn.com/wp-content/uploads/2019/10/image-11-416x290.png 416w, https://couchlearn.com/wp-content/uploads/2019/10/image-11-300x209.png 300w" sizes="(max-width: 638px) 100vw, 638px" /></figure>



<p>Once the Project Settings window opens, search for the Maps &amp; Modes option and click on it.</p>



<figure class="wp-block-image"><img decoding="async" width="1024" height="689" src="https://couchlearn.com/wp-content/uploads/2019/10/image-12-1024x689.png" alt="Opening the maps and modes section" class="wp-image-827" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-12-1024x689.png 1024w, https://couchlearn.com/wp-content/uploads/2019/10/image-12-416x280.png 416w, https://couchlearn.com/wp-content/uploads/2019/10/image-12-300x202.png 300w, https://couchlearn.com/wp-content/uploads/2019/10/image-12-768x516.png 768w, https://couchlearn.com/wp-content/uploads/2019/10/image-12.png 1258w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>At the bottom of the Maps &amp; Modes section look for the Game Instance Class drop down box.<br><br>Click this box and select your new Game Instance class. In my case, I named mine GameInstanceDemo in the previous step.</p>



<figure class="wp-block-image"><img decoding="async" width="625" height="169" src="https://couchlearn.com/wp-content/uploads/2019/10/image-13.png" alt="Configuring your game instance into the project" class="wp-image-828" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-13.png 625w, https://couchlearn.com/wp-content/uploads/2019/10/image-13-416x112.png 416w, https://couchlearn.com/wp-content/uploads/2019/10/image-13-300x81.png 300w" sizes="(max-width: 625px) 100vw, 625px" /></figure>



<h4 class="wp-block-heading">Accessing and Setting the Variables</h4>



<p>To start using your Game Instance right click in any of your blueprints (characters, actors etc) and type get game instance.<br><br><strong>This will retrieve the game instance with your set variables.</strong></p>



<figure class="wp-block-image"><img decoding="async" width="410" height="105" src="https://couchlearn.com/wp-content/uploads/2019/10/image-14.png" alt="Get the game instance through a blueprint node" class="wp-image-829" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-14.png 410w, https://couchlearn.com/wp-content/uploads/2019/10/image-14-300x77.png 300w" sizes="(max-width: 410px) 100vw, 410px" /></figure>



<p>From the pin of the Get Game Instance node create a cast node to your newly created Game Instance Class. <br><br>This cast node is named the same as your Game Instance set earlier.</p>



<figure class="wp-block-image"><img decoding="async" width="658" height="195" src="https://couchlearn.com/wp-content/uploads/2019/10/image-15.png" alt="Casting to the game instance" class="wp-image-830" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-15.png 658w, https://couchlearn.com/wp-content/uploads/2019/10/image-15-416x123.png 416w, https://couchlearn.com/wp-content/uploads/2019/10/image-15-300x89.png 300w" sizes="(max-width: 658px) 100vw, 658px" /></figure>



<p>From this new cast node you can set and get the values of your Game Instance variables.</p>



<figure class="wp-block-image"><img decoding="async" width="649" height="265" src="https://couchlearn.com/wp-content/uploads/2019/10/image-17.png" alt="Get the health and setting the health variable values" class="wp-image-833" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-17.png 649w, https://couchlearn.com/wp-content/uploads/2019/10/image-17-416x170.png 416w, https://couchlearn.com/wp-content/uploads/2019/10/image-17-300x122.png 300w" sizes="(max-width: 649px) 100vw, 649px" /></figure>



<p> In this example I will set the health value to 50 and load a new level which will print out the value. This value will stay the same as the Game Instance values are kept over different levels. </p>



<figure class="wp-block-image"><img decoding="async" width="864" height="243" src="https://couchlearn.com/wp-content/uploads/2019/10/image-18.png" alt="Setting the health variable to 50 and opening the next test level" class="wp-image-834" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-18.png 864w, https://couchlearn.com/wp-content/uploads/2019/10/image-18-416x117.png 416w, https://couchlearn.com/wp-content/uploads/2019/10/image-18-300x84.png 300w, https://couchlearn.com/wp-content/uploads/2019/10/image-18-768x216.png 768w" sizes="(max-width: 864px) 100vw, 864px" /><figcaption>Blueprint scripting for the first level</figcaption></figure>



<figure class="wp-block-image"><img decoding="async" width="613" height="313" src="https://couchlearn.com/wp-content/uploads/2019/10/image-19.png" alt="The second level blueprint code containing a print string to show the value of health on the screen" class="wp-image-835" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-19.png 613w, https://couchlearn.com/wp-content/uploads/2019/10/image-19-416x212.png 416w, https://couchlearn.com/wp-content/uploads/2019/10/image-19-300x153.png 300w" sizes="(max-width: 613px) 100vw, 613px" /><figcaption>Blueprint scripting for the second level</figcaption></figure>



<p>Loading the second level will print out the value of Health from our Game Instance. As this value was set to 50 in the first level the print string node will print the value 50 on the screen.</p>



<figure class="wp-block-image"><img decoding="async" width="528" height="286" src="https://couchlearn.com/wp-content/uploads/2019/10/image-20.png" alt="The value 50 printed on the screen" class="wp-image-836" srcset="https://couchlearn.com/wp-content/uploads/2019/10/image-20.png 528w, https://couchlearn.com/wp-content/uploads/2019/10/image-20-416x225.png 416w, https://couchlearn.com/wp-content/uploads/2019/10/image-20-300x163.png 300w" sizes="(max-width: 528px) 100vw, 528px" /><figcaption>Result of testing the Game Instance</figcaption></figure>



<h3 class="wp-block-heading">Conclusion</h3>



<p>Now that you have the knowledge to use the Game Instance in your Unreal Engine 4 game, you can now adapt this to your user interface through the widget system or onto your player character. <br><br>Doing so will give you the ability to switch levels without losing player values such as health, ammo and quest progress. <br><br>Those are only a few examples of what the Game Instance can do but there are many more ways to use saved values.</p>



<h4 class="wp-block-heading">More Complex Uses</h4>



<p>Using Discord Rich Presence in your game can be easily accessed by storing the Discord object in the Game Instance. <br><br><a href="https://couchlearn.com/how-to-use-discord-rich-presence-in-unreal-engine-4/">Click here to learn how to add Discord Rich Presence into your Unreal Engine 4 game.</a></p>
<p>The post <a href="https://couchlearn.com/how-to-use-the-game-instance-in-unreal-engine-4/">How to use the Game Instance in Unreal Engine 4</a> appeared first on <a href="https://couchlearn.com">Couch Learn</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://couchlearn.com/how-to-use-the-game-instance-in-unreal-engine-4/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: couchlearn.com @ 2026-04-15 17:16:03 by W3 Total Cache
-->