[UE4 C++] 06-Bind motion input (realize forward and backward movement, mouse steering)

Table of contents

1. WS moves back and forth

2. Mouse direction 


1. WS moves back and forth

In order to allow the "PlayerCharacter" controlled by the player to move forward and backward

 Add the following code in "SCharacter.cpp"

  Add the following code in "SCharacter.h"

Add axis mapping

Set up automatic player control

At this time, press the WS key to move forward and backward. 

2. Mouse direction 

Next, continue to implement the steering.

Add the following code in "SCharacter.cpp"

Add axis mapping

 At this point we can control the rotation with the mouse.

Guess you like

Origin blog.csdn.net/ChaoChao66666/article/details/131674617