<?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>ue4 input Archives - Couch Learn</title>
	<atom:link href="https://couchlearn.com/tag/ue4-input/feed/" rel="self" type="application/rss+xml" />
	<link>https://couchlearn.com/tag/ue4-input/</link>
	<description>Detailed Game Programming Tutorials</description>
	<lastBuildDate>Sun, 10 Jan 2021 23:55:07 +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>ue4 input Archives - Couch Learn</title>
	<link>https://couchlearn.com/tag/ue4-input/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to use Input Actions and Input Axis Mappings in your Unreal Engine 4 Game</title>
		<link>https://couchlearn.com/how-to-use-input-actions-and-input-axis-mappings-in-your-unreal-engine-4-game/</link>
					<comments>https://couchlearn.com/how-to-use-input-actions-and-input-axis-mappings-in-your-unreal-engine-4-game/#comments</comments>
		
		<dc:creator><![CDATA[Matt]]></dc:creator>
		<pubDate>Tue, 16 Jul 2019 02:17:07 +0000</pubDate>
				<category><![CDATA[Easy Difficulty]]></category>
		<category><![CDATA[UE4 Basics]]></category>
		<category><![CDATA[Unreal Engine]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[easy difficulty]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[ue4]]></category>
		<category><![CDATA[ue4 custom input]]></category>
		<category><![CDATA[ue4 input]]></category>
		<category><![CDATA[ue4 input actions]]></category>
		<category><![CDATA[ue4 input events]]></category>
		<category><![CDATA[unreal engine action mapping]]></category>
		<category><![CDATA[unreal engine axis mapping]]></category>
		<category><![CDATA[unreal engine input]]></category>
		<guid isPermaLink="false">https://couchlearn.com/?p=383</guid>

					<description><![CDATA[<p>From my previous projects one of the main suggestions that players asked for was to implement key/button bindings and an accompanying controls menu. Why bother? <a class="mh-excerpt-more" href="https://couchlearn.com/how-to-use-input-actions-and-input-axis-mappings-in-your-unreal-engine-4-game/" title="How to use Input Actions and Input Axis Mappings in your Unreal Engine 4 Game">[...]</a></p>
<p>The post <a href="https://couchlearn.com/how-to-use-input-actions-and-input-axis-mappings-in-your-unreal-engine-4-game/">How to use Input Actions and Input Axis Mappings in your Unreal Engine 4 Game</a> appeared first on <a href="https://couchlearn.com">Couch Learn</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>From my previous projects one of the main suggestions that players asked for was to implement key/button bindings and an accompanying controls menu. </p>



<h3 class="wp-block-heading">Why bother?</h3>



<p>Hard coded keys or buttons limits the gameplay of some players as they prefer their own custom layouts. Swapping the jump input, the sprint input or the crouch input fixes this for most.</p>



<p>Giving your players access to this feature will improve the quality of life your players will have throughout the entire experience.</p>



<h3 class="wp-block-heading">Improving the User Experience</h3>



<p>The first step to having fully bindable key inputs is to use Input Actions and Input Axes for your game. </p>



<p>These features can inform the engine exactly which feature you wish to rebind e.g. Shoot or Reload. Saving this to the Input configuration file is then easy so remembering your custom settings after your players reload their games.</p>



<h2 class="wp-block-heading">Finding the Input Settings Window</h2>



<p>To find the input settings window, click on Edit and find the Project Settings option.</p>



<figure class="wp-block-image"><img fetchpriority="high" decoding="async" width="596" height="460" src="https://couchlearn.com/wp-content/uploads/2019/07/image.png" alt="" class="wp-image-385" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image.png 596w, https://couchlearn.com/wp-content/uploads/2019/07/image-300x232.png 300w" sizes="(max-width: 596px) 100vw, 596px" /></figure>



<p>The Project Settings window will open up and look like this:</p>



<figure class="wp-block-image"><img decoding="async" width="1024" height="557" src="https://couchlearn.com/wp-content/uploads/2019/07/image-1-1024x557.png" alt="" class="wp-image-386" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-1-1024x557.png 1024w, https://couchlearn.com/wp-content/uploads/2019/07/image-1-300x163.png 300w, https://couchlearn.com/wp-content/uploads/2019/07/image-1-768x417.png 768w, https://couchlearn.com/wp-content/uploads/2019/07/image-1.png 1928w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>On the left hand side we can see all of the settings we can change in our project. Input contains what we need.</p>



<figure class="wp-block-image"><img decoding="async" width="625" height="381" src="https://couchlearn.com/wp-content/uploads/2019/07/image-2.png" alt="" class="wp-image-387" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-2.png 625w, https://couchlearn.com/wp-content/uploads/2019/07/image-2-300x183.png 300w" sizes="(max-width: 625px) 100vw, 625px" /></figure>



<p>On the right section of the Project Settings window we will now see all of the input settings that we can change in our project. </p>



<p>At the top you can see the two lists for Input Actions and Input Axis under the Bindings category</p>



<figure class="wp-block-image"><img decoding="async" width="376" height="284" src="https://couchlearn.com/wp-content/uploads/2019/07/image-4.png" alt="" class="wp-image-389" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-4.png 376w, https://couchlearn.com/wp-content/uploads/2019/07/image-4-300x227.png 300w" sizes="(max-width: 376px) 100vw, 376px" /></figure>



<h2 class="wp-block-heading">Action Mappings</h2>



<h3 class="wp-block-heading">What are Action Mappings?</h3>



<p>Action mappings are inputs that only output execution pins. Triggering these events can run new lines of blueprint code.</p>



<figure class="wp-block-image"><img decoding="async" width="184" height="137" src="https://couchlearn.com/wp-content/uploads/2019/07/image-21.png" alt="" class="wp-image-428"/></figure>



<h3 class="wp-block-heading">Examples of Action Mappings</h3>



<p>Action Mappings are perfect for single fire events such as reloading, jumping, crouching or shooting. Most inputs should use Action Mappings.</p>



<h3 class="wp-block-heading">Creating your Action Mappings</h3>



<p>To see the list of current Action Mappings, press the triangle to the left of the Action Mappings text.</p>



<figure class="wp-block-image"><img decoding="async" width="257" height="135" src="https://couchlearn.com/wp-content/uploads/2019/07/image-6.png" alt="" class="wp-image-391"/></figure>



<p>Here we can see all of the Action Mappings that my project uses. These are the defaults that come with the FirstPersonShooter template.</p>



<figure class="wp-block-image"><img decoding="async" width="287" height="110" src="https://couchlearn.com/wp-content/uploads/2019/07/image-7.png" alt="" class="wp-image-392"/></figure>



<p>To create a new Action Mapping press the + icon next to the Action Mappings list.</p>



<figure class="wp-block-image"><img decoding="async" width="441" height="193" src="https://couchlearn.com/wp-content/uploads/2019/07/image-5.png" alt="" class="wp-image-390" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-5.png 441w, https://couchlearn.com/wp-content/uploads/2019/07/image-5-300x131.png 300w" sizes="(max-width: 441px) 100vw, 441px" /></figure>



<p>Give the new Action Mapping a name that relates to what you want to use it for. In this case I named mine LightToggle as I am going to use this input for toggling lights in my level.</p>



<figure class="wp-block-image"><img decoding="async" width="448" height="164" src="https://couchlearn.com/wp-content/uploads/2019/07/image-9.png" alt="" class="wp-image-395" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-9.png 448w, https://couchlearn.com/wp-content/uploads/2019/07/image-9-300x110.png 300w" sizes="(max-width: 448px) 100vw, 448px" /></figure>



<p>From here you can now click the drop down box that current says None and select the key that you want this Action Mapping to use.</p>



<figure class="wp-block-image"><img decoding="async" width="469" height="381" src="https://couchlearn.com/wp-content/uploads/2019/07/image-10.png" alt="" class="wp-image-396" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-10.png 469w, https://couchlearn.com/wp-content/uploads/2019/07/image-10-300x244.png 300w" sizes="(max-width: 469px) 100vw, 469px" /></figure>



<p>Shift, Control, Alt and or Command have modifier boxes to the right that can also be ticked to make your input only work if they are pressed at the same time.</p>



<p>To add multiple input keys you can press the + symbol next to the name of the Action Mapping. This adds one extra key that will cause this event to trigger</p>



<figure class="wp-block-image"><img decoding="async" width="451" height="171" src="https://couchlearn.com/wp-content/uploads/2019/07/image-26.png" alt="" class="wp-image-435" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-26.png 451w, https://couchlearn.com/wp-content/uploads/2019/07/image-26-300x114.png 300w" sizes="(max-width: 451px) 100vw, 451px" /></figure>



<h3 class="wp-block-heading">Adding Functionality</h3>



<p>Now your Action Mapping&#8217;s are fully setup. Type the name of your Mapping inside your character or pawn blueprint event graph to get an event. <br><br>To use your new mapping in a non character or pawn blueprint, you will need to use the enable input node on begin play for that actor.<br><br><strong>This is due to actors not receiving input events by default</strong></p>



<figure class="wp-block-image size-large"><img decoding="async" width="374" height="262" src="https://couchlearn.com/wp-content/uploads/2020/03/image-8.png" alt="" class="wp-image-1096" srcset="https://couchlearn.com/wp-content/uploads/2020/03/image-8.png 374w, https://couchlearn.com/wp-content/uploads/2020/03/image-8-300x210.png 300w" sizes="(max-width: 374px) 100vw, 374px" /></figure>



<p> This fires when your custom input is pressed or released. </p>



<figure class="wp-block-image"><img decoding="async" width="533" height="174" src="https://couchlearn.com/wp-content/uploads/2019/07/image-29.png" alt="" class="wp-image-438" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-29.png 533w, https://couchlearn.com/wp-content/uploads/2019/07/image-29-300x98.png 300w" sizes="(max-width: 533px) 100vw, 533px" /></figure>



<h3 class="wp-block-heading">Input Action Event Testing</h3>



<p>To make sure that this input works I have attached two print string nodes to the InputAction. This prints &#8220;Light Toggle Pressed&#8221; when LightToggle input is pressed and &#8220;Light Toggle Released&#8221; when LightToggle is released.</p>



<figure class="wp-block-image"><img decoding="async" width="486" height="315" src="https://couchlearn.com/wp-content/uploads/2019/07/image-15.png" alt="" class="wp-image-417" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-15.png 486w, https://couchlearn.com/wp-content/uploads/2019/07/image-15-300x194.png 300w" sizes="(max-width: 486px) 100vw, 486px" /></figure>



<h2 class="wp-block-heading">Axis Mappings</h2>



<h3 class="wp-block-heading">What are Axis Mappings?</h3>



<p>Axis Mapping&#8217;s outputs a single execution pin every frame and also outputs a float value that is set by specific keys/buttons, control sticks or mouse inputs. </p>



<p>Different code can be run on the Axis value as each axis value is assigned is set to a different key.</p>



<figure class="wp-block-image"><img decoding="async" width="162" height="115" src="https://couchlearn.com/wp-content/uploads/2019/07/image-17.png" alt="" class="wp-image-420"/></figure>



<h3 class="wp-block-heading">Examples of Axis Mappings</h3>



<p>One example of this is the first person character template movement code. </p>



<p>Pressing no keys outputs 0. </p>



<p>Pressing the A key sets the float output to -1 and moves the player left. </p>



<p>When the player presses D the player moves right due to the float output being 1. </p>



<p>This output sets the scale of the add movement input function.</p>



<figure class="wp-block-image"><img decoding="async" width="528" height="214" src="https://couchlearn.com/wp-content/uploads/2019/07/image-19.png" alt="" class="wp-image-423" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-19.png 528w, https://couchlearn.com/wp-content/uploads/2019/07/image-19-300x122.png 300w" sizes="(max-width: 528px) 100vw, 528px" /></figure>



<p>The axis value is used for the mouse input to control the camera of the first person character. </p>



<figure class="wp-block-image"><img decoding="async" width="445" height="169" src="https://couchlearn.com/wp-content/uploads/2019/07/image-18.png" alt="" class="wp-image-421" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-18.png 445w, https://couchlearn.com/wp-content/uploads/2019/07/image-18-300x114.png 300w" sizes="(max-width: 445px) 100vw, 445px" /></figure>



<p>The horizontal movement of the mouse is converted to a float based on the direction and speed of the mouse and is sent to add controller yaw input to rotate the character.</p>



<h3 class="wp-block-heading">Creating Axis Mappings</h3>



<p>To see the list of current Axis Mappings, press the triangle to the left of the Axis Mappings text. </p>



<figure class="wp-block-image"><img decoding="async" width="202" height="109" src="https://couchlearn.com/wp-content/uploads/2019/07/image-20.png" alt="" class="wp-image-427"/></figure>



<p>Here are all of the Axis Mappings that my project uses. These are also the defaults that come with the FirstPersonShooter template. </p>



<figure class="wp-block-image"><img decoding="async" width="282" height="191" src="https://couchlearn.com/wp-content/uploads/2019/07/image-22.png" alt="" class="wp-image-431"/></figure>



<p>To create a new Axis Mapping press the + icon next to the Axis Mappings list. </p>



<figure class="wp-block-image"><img decoding="async" width="259" height="128" src="https://couchlearn.com/wp-content/uploads/2019/07/image-23.png" alt="" class="wp-image-432"/></figure>



<p>Axis Mappings contain a float which outputs when your specific key is pressed.</p>



<figure class="wp-block-image"><img decoding="async" width="351" height="63" src="https://couchlearn.com/wp-content/uploads/2019/07/image-27.png" alt="" class="wp-image-436" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-27.png 351w, https://couchlearn.com/wp-content/uploads/2019/07/image-27-300x54.png 300w" sizes="(max-width: 351px) 100vw, 351px" /></figure>



<p>I have assigned O to -1 and P to 1 in my Axis Mapping named KeyAxis.</p>



<figure class="wp-block-image"><img decoding="async" width="353" height="83" src="https://couchlearn.com/wp-content/uploads/2019/07/image-28.png" alt="" class="wp-image-437" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-28.png 353w, https://couchlearn.com/wp-content/uploads/2019/07/image-28-300x71.png 300w" sizes="(max-width: 353px) 100vw, 353px" /></figure>



<h3 class="wp-block-heading">Adding Functionality</h3>



<p>Axis Mapping are now setup. Typing the name of the newly created Mapping, inside of any blueprint event graph, shows an event that will fire your custom float value when your specified input is pressed.</p>



<p>As a result we can now see two different blueprint nodes when looking for your InputAxis.</p>



<figure class="wp-block-image"><img decoding="async" width="410" height="170" src="https://couchlearn.com/wp-content/uploads/2019/07/image-30.png" alt="" class="wp-image-439" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-30.png 410w, https://couchlearn.com/wp-content/uploads/2019/07/image-30-300x124.png 300w" sizes="(max-width: 410px) 100vw, 410px" /></figure>



<p>The first in the list gives you the event execution pin that fires every frame and the output float called Axis Value.</p>



<figure class="wp-block-image"><img decoding="async" width="178" height="105" src="https://couchlearn.com/wp-content/uploads/2019/07/image-31.png" alt="" class="wp-image-440"/></figure>



<p>The second in the list gives you just the output float.</p>



<figure class="wp-block-image"><img decoding="async" width="140" height="70" src="https://couchlearn.com/wp-content/uploads/2019/07/image-32.png" alt="" class="wp-image-441"/></figure>



<h3 class="wp-block-heading">Input Axis Event Testing</h3>



<p>To test, add a print string node to the execution pin of the KeyAxis event. Set the string value to the Axis Value from the output float from the event.</p>



<figure class="wp-block-image"><img decoding="async" width="321" height="148" src="https://couchlearn.com/wp-content/uploads/2019/07/image-33.png" alt="" class="wp-image-442" srcset="https://couchlearn.com/wp-content/uploads/2019/07/image-33.png 321w, https://couchlearn.com/wp-content/uploads/2019/07/image-33-300x138.png 300w" sizes="(max-width: 321px) 100vw, 321px" /></figure>



<p>Without pressing O and P the print outputs 0 every frame.</p>



<figure class="wp-block-image"><img decoding="async" width="91" height="221" src="https://couchlearn.com/wp-content/uploads/2019/07/image-34.png" alt="" class="wp-image-443"/></figure>



<p>Holding O prints this result:</p>



<figure class="wp-block-image"><img decoding="async" width="56" height="170" src="https://couchlearn.com/wp-content/uploads/2019/07/image-35.png" alt="" class="wp-image-444"/></figure>



<p>Holding P prints this result:</p>



<figure class="wp-block-image"><img decoding="async" width="50" height="161" src="https://couchlearn.com/wp-content/uploads/2019/07/image-38.png" alt="" class="wp-image-447"/></figure>



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



<p>Unreal Engine&#8217;s robust input now is fully working. Therefore, in the future, input can be rebound to different keys based on the users preference.  </p>



<p>Hard coding input causes difficulty down the road with every blueprint. Hard coded binds cannot be changed during runtime. </p>



<p>It&#8217;s worth getting into the habit of settings these up for every input you want to use for your games.</p>
<p>The post <a href="https://couchlearn.com/how-to-use-input-actions-and-input-axis-mappings-in-your-unreal-engine-4-game/">How to use Input Actions and Input Axis Mappings in your Unreal Engine 4 Game</a> appeared first on <a href="https://couchlearn.com">Couch Learn</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://couchlearn.com/how-to-use-input-actions-and-input-axis-mappings-in-your-unreal-engine-4-game/feed/</wfw:commentRss>
			<slash:comments>7</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:07:47 by W3 Total Cache
-->