How do I rotate a character so that it faces the vector direction of movement. Also how do I rotate it in such a way that it rotates the minimum distance? Right now my character spins 270 degrees to go (0,-1,0)
OrientRotationToMovement can be modified from the editor panel if you click the character movement component.
bOrientRotationToMovement
If true, rotate the Character toward the direction of acceleration, using RotationRate as the rate of rotation change.
Not sure what you mean by this. You don’t have to implement anything as ACharacter does it out of the box.
but you add it to World Direction, check the ThirdPersonTemplate - it uses Pawn’s Control Rotation, gets its Forward and Right Vector to move it relatively to actual Rotation
World X != Relative X - that means if you add Movement in World Space (f.ex. X = 1) - you will go towards world’s X which is static and always points to same direction, when you rotate your Player it’s still gonna move him towards the World’s X
That’s why you need the Control Rotation (in this particular case), Forward Vector for X and Right Vector for Y value
Like said - for visual tips open the 3rd Person Template as I cannot access UE now, if you run into weird issues with Camera - be aware that CameraBoom (Spring Arm) has also options that use Pawn’s Control Rotation and has settings affecting it
The thing is - this behaviour is already supported out of the box, as in post #2. There’s little else to do than to tick a checkbox… Unless the description is inaccurate, ofc.
If one wanted a smooth rotation with more manual control over the curve:
From what I can tell there is some kind of setting that exists in the game mode because. This isn’t working even if I were to use the template and reconstruct the character. There is some kind of integral component that needs to be turned on aside from OrientRotationToMovement. Note the jittery movement.
Prototyping game mechanics before filling in the world. Anyways it is interesting that recreating some of the movement of the third person template requires more than the blueprint. No one seems to know.
Okay I figured it out.
I was just going with the default settings. So I had to change…
Uncheck rotation for yaw (this was causing the jitter)
Camera boom. Use pawn rotation. (this allows the camera to maintain a fixed orientation… or something…)
I might’ve flipped something I’m not sure… I don’t think I did. Sorry if I ruined this for posterity.
This is a pretty good solution for what I was doing. Thank you. But I did get the character orientation to work as designed per the many suggestions.
You got it to work. On your own. Against all odds! And you posted the actual solution.