How to make realistic moving in different directions?

In the reality, the human cannot walk backwards or sideways as fast as forward, cannot run backwards and sideways, and cannot walk at diagonal direction at the speed that is vector sum of forward and sideways speed vectors:

In the UE by default character does all this:

In my game I have disabled running backwards and sideways, but in the bad way: when the user holds Shift and presses Down, Left or Right, there just happens nothing. The other two misabilities are currently not disabled:

How to make in UE blueprints the speed vectors in each direction as on the first image: walking backwards and sideways slightly slower than forward (1.5 times), running that ways at the same speed as walking (without full disabling) and 3 times slower than running forward, and diagonal moving vectors forming the rhombus or “kite” instead of square or rectangle?

EDIT: I mean that this movement must be validated on the server, the user must not be able to move as on the second image via the external “scanner” (and caller of the scanned functions).

There’s a couple of options you could try. First would be to clamp the x and y move input values when the sprint/run key is pressed. The second would be to directly set the max walk speed to a lower value when strafe or backward keys are pressed. The latter will give more control over the final speed, at the cost of adding extra walk speed variables to the class. This can get a bit wonky if you have any items that can increase movement speed.

Hello @illspiritx! But how the server will determine which keys are pressed? Commands to move the player somewhy can be called only on the client, where the “scanners” can avoid the limitations whereas on the server side there exists only the max speed, without the directions.

Pretty sure enhanced input can be replicated. And if you have the sprint button set a bool var that’s replicated, the function on server that sends move input to the char could use that bool to do a select float to grab either the raw input value or a clamped version. RPC stuff is kinda over my paygrade tho, so maybe someone else will chime in to give a better answer..

I have ran into similar situations. For example using addactorworld offsets driven by an Event Tick feed to move things. In such a case just change the values in the addactorworldoffset to achieve your assymetrical situation.

Use clamps to reduce the scale value.
Add movement Inputs “Scale” is a multiplier. By Default the scale is -1, 0, or 1.

1 * Max Walk Speed = Movement Speed

The image below reduces the Scale by half.
0.5 * Max Walk Speed = Movement Speed

Create a Function that you pass Axis X and Y to, then determine your movement direction and adjust the scale as needed, then pass that value to Add Movement Input.

@Etyuhibosecyu

I want to make sure you are aware that this approach is only valid for single player. It’s a huge cheat exploit for multiplayer.

For multiplayer this approach has to overhaul the Add Movement Input function directly in C++.

Optionally you create a comprehensive function that adjusts CMCs Max Walk/Crouch/Swim/Fly speeds directly and RPC the server to do the same.