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"

Forward Vector Becomes Offset When Player Is Rotated

Hello! I have a problem!

I'm making a 3rd person platforming game, and my game includes rotating platforms. When the player stands on them and rotates, controls get messed up. For example, if the player gets rotated 180 degrees, the controls are reversed, forward goes backward and etc.

I 'fixed' this by on tick rotating player movement to face the camera, however, everything in my player has its forward vector distorted. So, again, if the player is rotated 180 degrees, the forward vector now points 180 degrees in the wrong direction.

Is there any way to have controls AND forward axis remain consistent when rotating a player?

Product Version: UE 4.20
more ▼

asked Jan 24 '19 at 01:04 AM in Blueprint Scripting

avatar image

25 2 7

avatar image Evigmae Jan 24 '19 at 01:08 AM

should be consistent, can you show the nodes setup?

avatar image hello.aberdeen Jan 24 '19 at 01:16 AM

there is no node setup that messes with the player movement in the default, but here's the setup for me rotating player movement.

alt text

Doing it this way will offset the forward axis of everything, by which I mean that it stays in place regardless of the direction the player faces. The problem with this also is that the player wont actually rotate WITH the rotating platforms which is a lesser problem, but still.

I'd much rather have it act as it does normally (the player, camera, forward axis all rotate properly, but the player movement does not update).

ssasas.png (92.6 kB)
avatar image Evigmae Jan 24 '19 at 01:38 AM

yeah, i meant your movement setup, not your fix setup.

Ue4 has no such thing as a movement setup, just input and movement, but it's up to you where it moves to. so the problem is what you did, so please show me those nodes.

avatar image hello.aberdeen Jan 24 '19 at 01:43 AM

okay now im encountering a new problem. i've just tried to totally copy the 3rd person blueprint and i made this my movement setup

alt text

This fixes the issue of the rotating platforms, but has presented me with NEW issues. Now, the player no longer faces velocity (even though orient rotation towards movement is checked) and the only way to rotate the player is to rotate the camera, which I DONT want... I'd like rotating the camera to be entirely independent...

ssasas.png (103.6 kB)
avatar image Evigmae Jan 24 '19 at 02:03 AM

totally unrelated, but your blueprints are very ugly to look at.

avatar image ThompsonN13 Jan 24 '19 at 01:17 AM

also sounds like the way you have the controls setup / camera rotation isnt correct. did you setup your character the same as the thirdpersonexample? have you looked into orient movement to rotation.

rotation on tick sounds to me like a bandaid solution, meaning it fixes the immediate symptoms but doesnt fix the actual underlying issue. it also isnt a very performant method.

avatar image hello.aberdeen Jan 24 '19 at 01:22 AM

i currently just have it set on tick that the player rotates in the direction of velocity. even with that turned OFF, I still encounter the problem of the controls inverting when being rotated 180 degrees.

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

Don't use the pawn's Rotation. Instead use your pawn's ControlRotation's ForwardAxis. Alternatively, you can use you camera's ForwardAxis.

EDIT: Here's an example alt text

example.png (197.1 kB)
more ▼

answered Jan 24 '19 at 01:51 AM

avatar image

1.2k 8 4 7

avatar image hello.aberdeen Jan 24 '19 at 01:57 AM

yerp, that about does it, thanks a lot!

(comments are locked)
10|2000 characters needed characters left

Problem was solved by setting up movement like this:

alt text

ssasas.png (174.0 kB)
more ▼

answered Jan 24 '19 at 01:56 AM

avatar image

25 2 7

(comments are locked)
10|2000 characters needed characters left
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