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.
asked Jun 21 '16 at 06:03 AM in Blueprint Scripting
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.
answered Jun 22 '16 at 12:21 AM
Perhaps you need to connect Z break rot to Z make rot, I'm new too, but I think that'll work.
answered Mar 22 '18 at 07:49 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here