
Part 2 – Smooth WASD Camera Movement For Your RTS Game In Unreal Engine 5
Add smooth WASD camera movement to your RTS Pawn in UE5.6 using Enhanced Input, axis mapping, modifiers, and Blueprint logic for clean strategy controls.
This is Rambod, and this is Part 2 of the RTS Camera Series.
In Part 1 we set up the RTS Pawn, Controller, Game Mode, and Enhanced Input system with a test event. Now it’s time to build true WASD camera movement: smooth, responsive, and fully Blueprint-driven.
By the end of this tutorial, your RTS camera will glide across the map with WASD keys, just like in professional strategy games.
1) Create the MoveAction Input Asset
- Go to your Input/Actions folder.
- Right-click → Input → Input Action.
- Name it
IA_MoveAction
. - Open it and set Value Type = Axis2D.
👉 Axis2D gives you both X and Y in a single action (forward/back + right/left).
2) Bind WASD Keys in the Input Mapping Context
- Open your existing Input Mapping Context.
- Remove the old TestAction binding from Part 1.
- Add a new mapping → set it to
IA_MoveAction
. - Add four key bindings: W, S, A, D.
Modifiers setup:
- W → Swizzle Input Axis Values
- S → Swizzle Input Axis Values + Negate (for backwards)
- A → Swizzle Input Axis Values + Negate (for left)
- D → Swizzle Input Axis Values
📌 Swizzle rearranges axis order. For W/S, change Swizzle order to XZY to ensure correct forward/back direction.
3) Correct the Camera’s Spring Arm Rotation
In Part 1 we used the wrong values. Let’s fix it:
- Open BP_RTSPlayer.
- Select the Spring Arm.
- Set Rotation = (Pitch –105, Yaw 180, Roll 180).
This corrects the angled RTS perspective.
4) Add Floating Pawn Movement
Your Pawn needs a movement component:
- With BP_RTSPlayer selected, click Add Component.
- Search for Floating Pawn Movement and add it.
👉 Without this, AddMovementInput won’t work.
5) Set Up the Movement Logic
- Open BP_RTSPlayer → Event Graph.
- Delete the old
TestAction
event. - Right-click → search for
IA_MoveAction
event. - Expand the node.
- From the Action Value, drag out → add Break Vector2D.
- X = Forward/Back
- Y = Right/Left
Add Direction Vectors:
- Right-click → Get Actor Forward Vector.
- Right-click → Get Actor Right Vector.
Add Movement Input:
- Add two AddMovementInput nodes.
- Connect Forward Vector → World Direction of the first node.
- Connect Right Vector → World Direction of the second node.
Wiring values:
- From BreakVector2D:
- X → Scale Value of Forward Input.
- Y → Scale Value of Right Input.
✅ This gives smooth WASD camera movement based on pawn orientation.
6) Test the Setup
- Open MainMap.
- Press Play.
- Use W, A, S, D:
- W = Forward
- S = Backward
- A = Left
- D = Right
You’ll see the camera pawn move smoothly across the level with clean responsiveness.
7) Subtitle Expansion (Full Flow)
“In the last part, we set up our project and confirmed input worked. Now, create a new Input Action called MoveAction, set it to Axis2D. Bind it in the Input Mapping Context to W, S, A, and D. Add Swizzle modifiers for all keys, and Negate for S and A so backward and left movement work correctly. Fix the Spring Arm rotation on the pawn to 180, –105, 180. Add a Floating Pawn Movement component so the pawn can actually move. In the Event Graph, remove the old TestAction. Add MoveAction, expand it, and Break Vector2D. Use Get Actor Forward Vector and Get Actor Right Vector. Connect them into two Add Movement Input nodes. Wire X to forward, Y to right. Now when you press Play, W, A, S, D will smoothly move the pawn like a proper RTS camera.”
8) Wrap-Up
In Part 2, we:
- Created an Axis2D MoveAction.
- Bound WASD keys with modifiers.
- Fixed camera orientation.
- Added Floating Pawn Movement.
- Built clean Blueprint logic for movement.
- Tested & confirmed smooth WASD controls.
👉 In Part 3, we’ll add zoom and rotation to the RTS camera.
📦 GitHub: UE5 RTS Camera Tutorial
📚 Docs: Enhanced Input Documentation
💬 Discord: Join the Dev Community
🌍 More info: Rambod.net RTS Camera