Customizing control inputs

We have seen how the First Person template has mapped certain player input Actions, such as moving forward or jumping, to Blueprint nodes in order to produce the behavior for the Actions. In order to create new kinds of behavior, we will have to map new physical control inputs to additional player Actions. To change the input settings for your game, click on the Edit button in the Unreal Editor menu, and select the Project Settings option. On the left side of the window that appears, look for the Engine category and select the Input option.

Inside the Engine category, in the Input Settings menu, you will see two sections under the Bindings category called Action Mappings and Axis Mappings. You may need to click the little triangle on the left of each section to show the existing mappings. Action Mappings is for keypress and mouse click Events that trigger player Actions. Axis Mappings is meant for mapping player movements and Events that have a range, such as the W key and S key both affecting the Move Forward Action, but on different ends of the range. Both our Sprint and Zoom Functions are simple Actions that are either active or inactive, so we will add them as Action Mappings.

Click on the + sign next to Action Mappings twice to add two new Action mappings. Name the first Action Sprint, and select the Left Shift key from the drop-down menu to map that key to your Sprint Event. Name the second Action Zoom, and map it to Right Mouse Button. The changes are saved when you close the window.

Your Action Mappings inputs should match what is shown in the following screenshot:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset