Allow strafing while using Orient Rotation to Movement?

How would I go about making my character stay oriented to movement and be able to walk backwards?

If I turn on orient rotation to movement he will always rotate around until he faces the global -x and then will go backwards? Even if that’s not the way the backwards movement would’ve been.

If you move left/right the character rotates as expected. And then forward will of course move you forward, while backward does what I explained above.

I’m thinking some sort of toggle for allowing strafes but that sounds very un user friendly. Does anyone got any ideas on good 3rd/1st person movement/camera solutions? Ideally it would allow the player to have full movement in all 4 directions but then the character would rotate towards their velocity, it sounds like they’d inherently fight with no real solution in my head.

Now that I think about it should probably just have a bool for now that would be toggled by in-game context that I could edit later. Bool true would say that your in combat or whatever and allow strafe. Bool false would turn on orient to movement and allow turning like normal.

That would be the goal but again I have this weird walking backwards problem where it just always want to go to the global -x. Shouldn’t orient to movement just always turn for left/right and then forward/back should move like normal?

Any help appreciatted.

The way I have my movement for 3rd person set up is that by default the character is always facing the same direction as the camera, so W jogs forward, S jogs backward (backpeddling) and A and D strafe left and right. When the character is sprinting (holding Left Shift), the character faces the direction they are moving, regardless of camera direction.

Hopefully I explained that adequately, is that kind of what you are talking about?

Hmm I think I just explained my question bad. I’d like it to be that in third person when you move left/right your character would physically turn to face towards where they are moving and then move that way.

Instead with oreint rotation to movement he just spins on a/d and then s causes him to always face away from the global -x and walk backwards towards that.

But I’d like his back/forward movement to never rotate and instead move relative to the way he is facing.

At this point the camera is irrelevant but I’d aim for something more free overall I think where the camera can be moved any which way and doesn’t really effect movement.

I’m still figuring out how I want movement to work so this is subject to change mostly just playing with different ideas and trying to find what works and what feels the best.

Got it. So if I understand right you have a camera direction in third person, you want the character:

W: Moving forward, facing forward (same as camera)

S: Moving backwards, facing forward (moving toward camera, facing the same as camera, backpedaling)

A: Moving feft, facing left

D: Moving right, facing right

What I would do is create a blendspace (you can make it a 2d blendspace if you want different animations for walking/jogging/spriniting, etc, but 1d will work for this example). Assign the axis to -180 min and 180 max and give it like 5 or 6 divisions. Then put your run backwards animation on the far left and far right on the track (-180 and 180) and your run forward animation on the next division in from either side (like -120, and 120 or whatever).

Then in the anim blueprint, you can feed in your characters direction as the variable for the blend space and it’ll pick the right animation for the right direction. However, depending on how your controls are set up you might end up with a running forward animation while strafing. If that’s the case, in your anim graph you can add a Transform Bone node, select your root bone as the transform node and feed your direction variable into the Z rotation for the transform.

Lemme know if that makes sense, if not I can take some screenshots.

Well my character is just a cube until I work out how I want the model to look in blender so the animations isn’t what the issue is. I just want to get the movement system down before I start anything else.

So darksouls might be a good example here. Their movement is relative to the camera I believe. I don’t want that but the idea is in darksouls the character will always move forward/back and then when you have them move left/right they first turn to face that way and then move left or right.

It’s almost like orient rotation to movement is active until the turn is completed and then they just move left how they should. I don’t know a good solution in ue4 though… Some sort of way to enable orient rotation to movement on a/d and then have it disable when the character forward vector=“x”?

My biggest issue is that orient rotation to movement doesn’t allow actual turns in place, it’s more they turn while they’re moving towards whatever direction. I’m on the fence of whether or not the camera pos should effect this because I’d like the player to be able to look around while they move.

For keyboard and mouse, something like WoW controls sounds like what you want. Mouse looks around, WASD moves in that direction, you can freely look, if you walk in a direction without using a mouse direction, the camera corrects itself slowly.

This guy’s got something you might be able to start with. If you don’t need the mouse cursor then just use the section with the mouse button held as the default control scheme.

Is this for keyboard/mouse or for controller? Sounds like you kinda want to have 2 joystick movement where right stick controls the camera, and left stick moves you around. That is what Darksouls is doing (at least with a controller, dunno about on PC). But, if its for a keyboard/mouse you could also try having the movement of the character steer the camera using some sort of interpolation on the camera movement. So it doesn’t just snap to the character movement, it kinda lags behind a bit and corrects itself to facing forward as the character moves. That way you could start running left, character would point that direction, then the camera would start to turn to face forward as you continued. Still kinda fuzzy on what you want exactly though, do you have a video of a game with the controls you want?

Yeah keyboard + mouse. I just played some dark souls to remember it and it’s pretty spot on to what I want honestly.

Darksouls doesn’t move the camera for you but it seems that no matter what the forward/back and left/right just move you relative to the camera and if you move it while walking you have to self correct your movement which I guess is alright.

I would just like something similar to that but I want players to be able to look around and ■■■■. Having movement relative to camera might work and then allowing player to still free move it as well.

Yeah keyboard + mouse. I guess darksouls is probably as close as I can get to what I want. I just hate the idea of the camera deciding player movement when in third person because I want the player to be able to freely look around but my first solution is basically tank controls and that’s even worse.

So maybe just allow the camera springarm to decide it and just allow the camera to lag slightly behind the sprinarm, and then give the player free reign of the camera? That way the spring arm is always gonna stay attached and decide movement and the player still looks around?

Then if the player doesn’t move it or anything then the camera would self correct slowly since it follows it’s parent.

I don’t got any videos I guess just dark souls or something.

H*** yeah dude thanks for the help. I’ll give it a look. Accidently dropped an f bomb in a comment before so you’re gonna get a dupe notification in 22 hours when a mod approves my comment.

No problem, if that works for you I’ll convert my comment to an answer so other people can see it easily.