x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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!!!!! alt text alt text

Product Version: UE 4.12
Tags:
duda.png (129.7 kB)
duda2.png (97.8 kB)
more ▼

asked Jun 21 '16 at 06:03 AM in Blueprint Scripting

avatar image

cgmpalencia
5 4 6 10

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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.

more ▼

answered Jun 22 '16 at 12:21 AM

avatar image

1l2Hawk
690 36 35 74

avatar image cgmpalencia Jun 23 '16 at 12:27 AM

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!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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

more ▼

answered Mar 22 '18 at 07:49 PM

avatar image

Forestwolf42
18 3 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question