How do I set up running along with the camera?

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

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

1 Like

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. :sweat_smile:

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)

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

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

And camera rotating


This is my first interaction with Ue5 and blueprints
So I might be doing something wrong

1 Like

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 :slight_smile:

Forward movement

Backward movement

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

Left movement

Right movement

Mapping context

Actions

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

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

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

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)

I maked new template for testing




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 :slight_smile:

1 Like

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

1 Like

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

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

Thanks a lot

1 Like

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