Direction movement and look

Hello! I’ve got a problem with my character movement. It’s really strange because I followed a tutorial and this didn’t happened there.

When I try to move with my character in the scene and I press the moving controls whithout rotating the camera it works fine, but whenever i rotate it with the mouse the character keep moving in the same axis. So, when I rotate the camera 180 degrees and I press the W key it moves backwards.

I also have a problem with the look up and down script, because my mouse only allows me to move in the horizontal plane but I can´t look to the celling or the floor of the scene.

Here i post an image of my blueprint and my input settings.

Thank you!!!

This might sound a little abstract, but there’s a Player Controller representing ‘you’ sitting there in your gamer chair that persists as long as the game is running. That doesn’t have a physical representation in the game all by itself and therefore doesn’t really need to move around, so think of it as an invisible soul sitting at the 0,0,0 location on the map by default. The Character you’ve made is an actor in the world that this controller possesses and drives around in any xyz position the game allows, so that’s like a mindless physical body of a clone. That can be killed off and respawned for your player controller to simply take control of over and over again.

One thing you might want to do is go into your Player Controller on the details panel and open Controller->Transform->Attach To Pawn and set that to true. That will help make sure wherever you ask about the control rotation (where is my soul looking?), it should be the same as your Character (where is my body looking?). This is why everything is backwards when you move your mouse 180. Bottom left image you are using an input to turn your soul around, but nothing tells the body to turn around with it. Then up top you ask “hey, which way is the control rotation?” to get a forward vector and it answers with “Uh, right now? Looks like downward to me”. Left on the soul is right on the body.

I’d cut out those first three nodes and just feed a “Get Actor Rotation” straight up into the two Get Vector ones. That way forward is always forward on the character and right is always right. That takes care of moving straight and strafing to the side, but it wont turn your guy.

For that, you can go into your Character BP - pick on the Movement Component - and type “rotation” in the top of the Details panel. That will give you some interesting behaviors - such as “Orient Rotation to Movement” (dont use this unless you always want to look in the direction the player is headed), and “Use Controller Desired Rotation” (which seems a better option for the input code you have written already). A zero in the Pitch rate here might also be a problem for you. Hope that’s not too confusing.

Thank you for the answer, but I’m still really lost. I’m new in Unreal… Could you post some screenshoots to show me where can I find that stuff? Thanks a lot for your time!

Perhaps you need to connect Z break rot to Z make rot, I’m new too, but I think that’ll work.

I know it’s been a while since you asked this, but for your question around moving the character in relation to the direction you’re looking, that’s easy. You just have to set up your input to be based on the camera’s facing rather than the controller.

Here’s what I have set up that works well:

1 Like