# How do I set up running along with the camera?

**URL:** <https://forums.unrealengine.com/t/how-do-i-set-up-running-along-with-the-camera/1908544>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question, Blueprint\
**Created:** [June 19, 2024, 4:01am UTC](https://forums.unrealengine.com/t/how-do-i-set-up-running-along-with-the-camera/1908544 "2024-06-19T04:01:34Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deadlyo0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Deadlyo0](https://forums.unrealengine.com/u/Deadlyo0)\
**Post date:** [June 19, 2024, 4:01am UTC](https://forums.unrealengine.com/t/how-do-i-set-up-running-along-with-the-camera/1908544/1 "2024-06-19T04:01:34Z")

</div>

I made a simple code to rotate the camera in Top-Down, I also have WASD set as character movement.

Someone can tell me how to change the moving so that when I rotate the camera W will swap functions with S?  
That is, I look north with the camera, press W and the character goes north.  
I rotate the camera 180\* and W continues to direct the character north instead of south.

Below are screen shots of my setup  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/7/4/174f9109991f53d4da40704fb8e2b9224780b1e1.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/8/b/88bd778d5b80c87e0a594ca1d4ef54e69cf4a440.png)

And the video, at the beginning I press W and go up the map.

Then I press “S” and go down, then turn the camera and press “S” again and the character still goes in the same direction instead of going up

---

<div class="post-metadata">

**Author:** ![tolacipeetahi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tolacipeetahi](https://forums.unrealengine.com/u/tolacipeetahi)\
**Post date:** [June 19, 2024, 5:10am UTC](https://forums.unrealengine.com/t/how-do-i-set-up-running-along-with-the-camera/1908544/2 "2024-06-19T05:10:09Z")

</div>

You need to get the direction of the spring arm and apply movement to the actor based on that. Nothing in your code is connecting those two things at the moment. 😅

I went in the top down blueprint and changed nothing except making a forward movement EIA (axis1d), and mouseinput (axis2d), and it works how you’re wanting (except the ASD keys of course, which you can set up by following this exactly)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/0/4/50426fb52ce1552626365a8f8f31104a23346769.jpeg)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/d/1/ad191aa7d781b1c5a287d713469ba2981b435dec.png)

If you run into any further issues getting this working, let me know! 🙂

---

<div class="post-metadata">

**Author:** ![Deadlyo0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Deadlyo0](https://forums.unrealengine.com/u/Deadlyo0)\
**Post date:** [June 19, 2024, 4:16pm UTC](https://forums.unrealengine.com/t/how-do-i-set-up-running-along-with-the-camera/1908544/3 "2024-06-19T16:16:16Z")

</div>

It not working for me.  
When the game is launched, indeed the character runs along with the camera rotation.

But when I press the key to move it all goes back to the basic settings and again the character runs up and not where I turn the camera

In addition, I changed the controls a bit and instead of an additional class with controls I just added it to the settings, now this is how my character’s movement in the world looks like

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/7/7/177b80000e6f762db9618760a6c3e2000ed39af8.png)

And camera rotating

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/d/4/3d49f9bffe26d822ec0841e6de49636ddc14593c.png)  
This is my first interaction with Ue5 and blueprints  
So I might be doing something wrong

---

<div class="post-metadata">

**Author:** ![tolacipeetahi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tolacipeetahi](https://forums.unrealengine.com/u/tolacipeetahi)\
**Post date:** [June 19, 2024, 5:14pm UTC](https://forums.unrealengine.com/t/how-do-i-set-up-running-along-with-the-camera/1908544/4 "2024-06-19T17:14:39Z")

</div>

It is because you are in the player controller instead of the character

I made a solution for you in player controller that is fully functional that you can copy for WASD movement. I included all relevant information so you can learn what you need 🙂

Forward movement

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/a/0/0a07591d8d0e8bc6902949084aead91759b532ef.jpeg)

Backward movement

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/9/7/097c582c90aeff1c05f1dadc673bb87381b9f9a9.jpeg)

Mouse controls (this only works when holding RMB as intended)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/6/9/f69649a6e596217664ced744eb3cd7f642e1a7e5.png)

Left movement

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/5/a/a5a4e9856e62553db978286348bae72e4d6987b3.jpeg)

Right movement

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/7/9/579b6a8b0a1df306943668915e907210e57c49d6.jpeg)

Mapping context

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/e/2/0e2a50df6dd4c6840b111e5172ad346be5884b61.png)

Actions

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/1/b/c1b9026995bb4180c10c04102df66e0817de740d.png)

---

<div class="post-metadata">

**Author:** ![Deadlyo0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Deadlyo0](https://forums.unrealengine.com/u/Deadlyo0)\
**Post date:** [June 19, 2024, 6:38pm UTC](https://forums.unrealengine.com/t/how-do-i-set-up-running-along-with-the-camera/1908544/5 "2024-06-19T18:38:18Z")

</div>

Sorry but still nothing  
I make this project from template top-down in ue5 menu  
Just remove mouse movement and add my own WSAD

I made everything with your pics

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/b/a/9ba1b10959a1897514dd2576185519a4f853d21a.jpeg)

And this is how my camera is set after i click “play” (before rotate it)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/0/9/b09bc6d1c1ddc9d21a788a5f24bcb4453b3b63d2.jpeg)

---

<div class="post-metadata">

**Author:** ![tolacipeetahi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tolacipeetahi](https://forums.unrealengine.com/u/tolacipeetahi)\
**Post date:** [June 19, 2024, 9:29pm UTC](https://forums.unrealengine.com/t/how-do-i-set-up-running-along-with-the-camera/1908544/6 "2024-06-19T21:29:09Z")

</div>

Going to need more information then, my code is working perfectly in a blank top down project. Here is a sample of what my code does [https://www.youtube.com/watch?v=wUg2cKgyDg0](https://www.youtube.com/watch?v=wUg2cKgyDg0)

> **Summary**
>
> I added the IA’s, added the IA’s to the IMC, deleted everything in the player controller except to add the mapping context, then pasted in the nodes for forward backwards left and right and it’s working exactly as expected on 2 different projects.

Post full editor screenshots of your copied player controller event graph, your IMC, and your character blueprint (unless it’s empty)

---

<div class="post-metadata">

**Author:** ![Deadlyo0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Deadlyo0](https://forums.unrealengine.com/u/Deadlyo0)\
**Post date:** [June 19, 2024, 10:32pm UTC](https://forums.unrealengine.com/t/how-do-i-set-up-running-along-with-the-camera/1908544/7 "2024-06-19T22:32:05Z")

</div>

I maked new template for testing

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/e/5/2e54d792b1719bfdbc7a7f19ed0c3582a150d0ed.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/1/8/018bb100838513c07806289aa1aa8a9660e56270.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/f/e/9feefde5fb5e7efd359cf1e7fb871b2d594de8cc.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/8/d/d8deb87f52a7652f7cf673f64f744a5f7ea7929d.jpeg)

---

<div class="post-metadata">

**Author:** ![tolacipeetahi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tolacipeetahi](https://forums.unrealengine.com/u/tolacipeetahi)\
**Post date:** [June 19, 2024, 10:42pm UTC](https://forums.unrealengine.com/t/how-do-i-set-up-running-along-with-the-camera/1908544/8 "2024-06-19T22:42:49Z")

</div>

You did not add mapping context in these screenshots, **you must select the asset** and do not use “add mapping context (message)” node. I believe your code in the character BP is also doing nothing, experiment with removing it all together during this troubleshooting process.

Please make these changes and add these debugging statements to your code and report back 🙂

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/f/5/7f5a5423a1fbc62ce884dcdef3612213f2839d17.jpeg)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/6/a/96ae6cffcded98c0ea438b63c02d265b6135b9e9.jpeg)

---

<div class="post-metadata">

**Author:** ![Deadlyo0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Deadlyo0](https://forums.unrealengine.com/u/Deadlyo0)\
**Post date:** [June 19, 2024, 11:20pm UTC](https://forums.unrealengine.com/t/how-do-i-set-up-running-along-with-the-camera/1908544/9 "2024-06-19T23:20:49Z")

</div>

I overlooked such a small detail as selecting a file.  
Thanks a lot

Now the character runs in the indicated direction but with a slight deviation, I need to increase the strength of this turning along with the 1:1 camera

---

<div class="post-metadata">

**Author:** ![tolacipeetahi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tolacipeetahi](https://forums.unrealengine.com/u/tolacipeetahi)\
**Post date:** [June 19, 2024, 11:22pm UTC](https://forums.unrealengine.com/t/how-do-i-set-up-running-along-with-the-camera/1908544/10 "2024-06-19T23:22:10Z")

</div>

I believe this new issue is because of this segment of code, remove the add movement input and everything attached to it

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/1/0/d10079305a596f98a0e5215579adfde5dfb87822.jpeg)

---

<div class="post-metadata">

**Author:** ![Deadlyo0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Deadlyo0](https://forums.unrealengine.com/u/Deadlyo0)\
**Post date:** [June 19, 2024, 11:37pm UTC](https://forums.unrealengine.com/t/how-do-i-set-up-running-along-with-the-camera/1908544/11 "2024-06-19T23:37:50Z")

</div>

Now it works perfectly, one small mistake and it cost half a day of explanation.

Thanks a lot

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [July 19, 2024, 11:38pm UTC](https://forums.unrealengine.com/t/how-do-i-set-up-running-along-with-the-camera/1908544/12 "2024-07-19T23:38:28Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
