How to set up a first-person character in Unreal Engine 4/5 with Blueprints
To build a first-person character you create a blank project, a Game Mode Base and a Character Blueprint, map the inputs in Project Settings, add a Camera at eye height and use Add Movement Input, Add Controller Yaw Input and Add Controller Pitch Input in the Event Graph. Keyboard keys need negative scale values for backward and left.
From the course
Taken from the hands-on project of the course; the lessons show every step on video.
How do I start the project?
- Create a new Blueprint project with blank content, no starter content and desktop at maximum quality.
- In a Blueprints folder create a GameModeBase, for example FirstPersonGameMode, and a Character Blueprint, FirstPersonCharacter.
- In the Game Mode set the Default Pawn Class to the new character.
How do I map the inputs?
In Project Settings, Input, there are Action Mappings (keys or buttons that act when pressed or released, such as jump) and Axis Mappings (movement along axes). Create these axis mappings:
- Move Forward: W and Up arrow (+1), S and Down arrow (-1), and the Gamepad Left stick on the Y axis.
- Move Right: D (+1) and A (-1) and the Gamepad Left stick on the X axis.
- Turn: the mouse X axis, and Turn Rate: left and right arrows with the right stick X axis. Look Up: the mouse Y axis, with Look Up Rate on the right stick Y axis.
- Keys send a single value, so give S, A and the Down and Left arrows a scale of -1; analog sticks already send values in both directions. The mouse Y axis for Look Up needs a scale of -1 to not be inverted.
What does the character Blueprint already have?
A Capsule component for collision, an Arrow showing the facing direction, a Mesh for a skin and a Character Movement component. Add a Camera named First Person Camera attached to the capsule, turn on Use Pawn Control Rotation so the camera rotates with the character and raise it to a height of 64 on Z, about eye level.
How do I program movement?
- Delete the initial nodes and add the Move Forward axis event. Call Add Movement Input with the character as target, Get Actor Forward Vector as World Direction and the axis value as Scale Value.
- Do the same for Move Right with Get Actor Right Vector.
- For rotation, connect Turn to Add Controller Yaw Input and Look Up to Add Controller Pitch Input; copy them for Turn Rate and Look Up Rate for the gamepad.
How do I add the character to the scene?
Either set the Game Mode as the default, with a Player Start in the level, or drag the character into the scene and set Auto Possess Player to Player 0. Both work; choose by what your project needs.
Free PDFs that go with this page
One-page guides made from the lessons, sent by e-mail.
- Interactive archviz delivery checklist — The things that go wrong in interactive scenes, checked one by one, each item tied to a lesson.
- Blueprint Cheat Sheet — A free one-page PDF for Unreal Engine 4/5, made from the lessons of the course. Keep it next to your editor while you learn.
- Free PDFs
Frequently asked questions
Why does S move my character forward?
Because the keyboard key sends 1. Give S, A and the Down arrow a scale of -1 in the Axis Mappings.
Why is the mouse Look Up inverted?
Set the scale of the Y axis mapping to -1.
What do I set as the camera height?
In the lesson, 64 on the Z axis.