<?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>parent and child Archives - Couch Learn</title>
	<atom:link href="https://couchlearn.com/tag/parent-and-child/feed/" rel="self" type="application/rss+xml" />
	<link>https://couchlearn.com/tag/parent-and-child/</link>
	<description>Detailed Game Programming Tutorials</description>
	<lastBuildDate>Sun, 10 Jan 2021 23:54:39 +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>parent and child Archives - Couch Learn</title>
	<link>https://couchlearn.com/tag/parent-and-child/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Parent and Child Blueprints in Unreal Engine 4</title>
		<link>https://couchlearn.com/parent-and-child-blueprints-in-unreal-engine-4/</link>
					<comments>https://couchlearn.com/parent-and-child-blueprints-in-unreal-engine-4/#respond</comments>
		
		<dc:creator><![CDATA[Matt]]></dc:creator>
		<pubDate>Tue, 30 Jul 2019 14:56:35 +0000</pubDate>
				<category><![CDATA[Easy Difficulty]]></category>
		<category><![CDATA[UE4 Basics]]></category>
		<category><![CDATA[Unreal Engine]]></category>
		<category><![CDATA[blueprint]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[easy difficulty]]></category>
		<category><![CDATA[inheritance]]></category>
		<category><![CDATA[parent and child]]></category>
		<category><![CDATA[ue4]]></category>
		<category><![CDATA[unreal engine]]></category>
		<guid isPermaLink="false">https://couchlearn.com/?p=457</guid>

					<description><![CDATA[<p>In this guide I will be going through Parent and Child blueprints in Unreal Engine 4. They are a key part of making manageable code <a class="mh-excerpt-more" href="https://couchlearn.com/parent-and-child-blueprints-in-unreal-engine-4/" title="Parent and Child Blueprints in Unreal Engine 4">[...]</a></p>
<p>The post <a href="https://couchlearn.com/parent-and-child-blueprints-in-unreal-engine-4/">Parent and Child Blueprints in Unreal Engine 4</a> appeared first on <a href="https://couchlearn.com">Couch Learn</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In this guide I will be going through Parent and Child blueprints in Unreal Engine 4. They are a key part of making manageable code and preventing repeated blueprint nodes in similar classes.</p>



<p>Inheritance is an important feature in many object oriented programming languages. It allows programmers to create variations of an object and communicate with them as if they are all the same original type.</p>



<p>Blueprints also have the ability to have child classes and have parent classes that they inherit from.</p>



<p>If you want to learn more about the theory behind inheritance, <a href="https://www.w3schools.com/cpp/cpp_inheritance.asp">click here for a tutorial from w3 schools showing inheritance in C++.</a></p>



<h2 class="wp-block-heading">Parent Class</h2>



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



<p>To start, create a new blueprint actor and name it ParentActor.</p>



<figure class="wp-block-image"><img fetchpriority="high" decoding="async" width="544" height="442" src="https://couchlearn.com/wp-content/uploads/2019/07/image-67.png" alt="Creating the parent blueprint class" class="wp-image-604" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-67.png 544w, https://couchlearn.com/wp-content/uploads/2019/07/image-67-300x244.png 300w" sizes="(max-width: 544px) 100vw, 544px" /></figure>



<p>This actor can now be filled with events, input actions, variables, functions and more. All of these attributes will be shared to our child actors.</p>



<p><a href="https://couchlearn.com/how-to-use-input-actions-and-input-axis-mappings-in-your-unreal-engine-4-game/">If you don&#8217;t know how to use input actions and input axes click here for a detailed run down on how to include these powerful events into your project.</a></p>



<h3 class="wp-block-heading">Setting up the Parent Class</h3>



<p>To demonstrate, I have created two keybinds, an event, a function and a float variable. </p>



<p>Pressing 1 will set this float value to 1 and pressing 2 will set the float value to 2.</p>



<figure class="wp-block-image"><img decoding="async" width="275" height="385" src="https://couchlearn.com/wp-content/uploads/2019/07/image-72.png" alt="Setting up the parent class with basic inputs and setting variables" class="wp-image-609" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-72.png 275w, https://couchlearn.com/wp-content/uploads/2019/07/image-72-214x300.png 214w" sizes="(max-width: 275px) 100vw, 275px" /></figure>



<h2 class="wp-block-heading">Child Class</h2>



<h3 class="wp-block-heading">Creating a child class</h3>



<p>Creating a child class from your chosen parent class is very easy.</p>



<p>To create a new class based on a previous simply right click your chosen class in the content browser and click create child blueprint.</p>



<figure class="wp-block-image"><img decoding="async" width="267" height="536" src="https://couchlearn.com/wp-content/uploads/2019/07/image-69.png" alt="Creating the child blueprint class" class="wp-image-606" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-69.png 267w, https://couchlearn.com/wp-content/uploads/2019/07/image-69-149x300.png 149w" sizes="(max-width: 267px) 100vw, 267px" /></figure>



<h3 class="wp-block-heading">Accessing the parent</h3>



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



<p>Inside the child actor there are no visible variables of the left side.</p>



<figure class="wp-block-image"><img decoding="async" width="288" height="167" src="https://couchlearn.com/wp-content/uploads/2019/07/image-71.png" alt="No functions, variables or macros shown in child class" class="wp-image-608"/></figure>



<p>Right clicking and searching for your parent variables will reveal them in the default section.</p>



<figure class="wp-block-image"><img decoding="async" width="415" height="455" src="https://couchlearn.com/wp-content/uploads/2019/07/image-70.png" alt="Parent variables showing in child class" class="wp-image-607" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-70.png 415w, https://couchlearn.com/wp-content/uploads/2019/07/image-70-274x300.png 274w" sizes="(max-width: 415px) 100vw, 415px" /></figure>



<h4 class="wp-block-heading">Events and Functions</h4>



<p>Right clicking inside your child blueprint class and typing the name of your functions and events will give you access to them.</p>



<figure class="wp-block-image"><img decoding="async" width="410" height="183" src="https://couchlearn.com/wp-content/uploads/2019/07/image-75.png" alt="Parent events showing in child class" class="wp-image-612" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-75.png 410w, https://couchlearn.com/wp-content/uploads/2019/07/image-75-300x134.png 300w" sizes="(max-width: 410px) 100vw, 410px" /></figure>



<p>Key events will override any code that is on the same parent event. This child class will now print 10 on key press 1 and 20 on key press 2.</p>



<figure class="wp-block-image"><img decoding="async" width="293" height="253" src="https://couchlearn.com/wp-content/uploads/2019/07/image-79.png" alt="Child key inputs run different code" class="wp-image-616"/></figure>



<p>To make sure the parent code runs as well as the child code on these key inputs, click on the input and look to the right of the details panel.</p>



<p>Un-checking the &#8220;Override Parent Binding&#8221; box will run both sections of code. If you want your child to have different behaviors on the same key presses you can leave this checked.</p>



<figure class="wp-block-image"><img decoding="async" width="597" height="162" src="https://couchlearn.com/wp-content/uploads/2019/07/image-80.png" alt="Parent bindings overridden on child class" class="wp-image-617" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-80.png 597w, https://couchlearn.com/wp-content/uploads/2019/07/image-80-300x81.png 300w" sizes="(max-width: 597px) 100vw, 597px" /></figure>



<h4 class="wp-block-heading">Running Parent Code</h4>



<p>When accessing parent functions and events you are stopping the parent code from running. This is called overriding.</p>



<p>To make sure the parent code runs during the event, right click the specific event and click Add Call to Parent Function.</p>



<figure class="wp-block-image"><img decoding="async" width="313" height="256" src="https://couchlearn.com/wp-content/uploads/2019/07/image-77.png" alt="Creating the parent function call" class="wp-image-614" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-77.png 313w, https://couchlearn.com/wp-content/uploads/2019/07/image-77-300x245.png 300w" sizes="(max-width: 313px) 100vw, 313px" /></figure>



<figure class="wp-block-image"><img decoding="async" width="492" height="77" src="https://couchlearn.com/wp-content/uploads/2019/07/image-78.png" alt="Connecting the parent event" class="wp-image-615" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-78.png 492w, https://couchlearn.com/wp-content/uploads/2019/07/image-78-300x47.png 300w" sizes="(max-width: 492px) 100vw, 492px" /></figure>



<p>Now when custom parent event is fired the child code will run and the parent code will run. The expected output is &#8220;Hello From Parent Class&#8221; on screen.</p>



<figure class="wp-block-image"><img decoding="async" width="451" height="177" src="https://couchlearn.com/wp-content/uploads/2019/07/image-76.png" alt="Parent event printing strings to the screen" class="wp-image-613" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-76.png 451w, https://couchlearn.com/wp-content/uploads/2019/07/image-76-300x118.png 300w" sizes="(max-width: 451px) 100vw, 451px" /></figure>



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



<p>That is the basics of parent and child classes in unreal engine 4! </p>



<p>Designing your code to utilize this powerful technique will improve the readability and efficiency of your game development processes.</p>
<p>The post <a href="https://couchlearn.com/parent-and-child-blueprints-in-unreal-engine-4/">Parent and Child Blueprints in Unreal Engine 4</a> appeared first on <a href="https://couchlearn.com">Couch Learn</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://couchlearn.com/parent-and-child-blueprints-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:15:22 by W3 Total Cache
-->