Download

How to make Character walk speed different on X axis and Y axis (top-down view)

Hello everyone, hoping you can help me with this little problem.
I have a Character Blueprint, i already set WASD input in input settings, and this is the blueprint:

What I’m trying to achieve:

  • Top-down camera
  • W and S moves player on X axis
  • A and D moves player on Y axis
  • X axis and Y axis movement must have different speeds, and I have to set them

And the last point is the problem. I’ve created 2 float variables to handle X and Y speed (XSpeed and YSpeed variables) and attached them like in the image.
The problem:

  • If I use only one variable (example, XSpeed), it gets applied to both X and Y movement
  • If I use both variables, they get ignored totally and speed have whatever default value Unreal sets.

I think the problem lies in the “Set max walk speed” block, but I can’t understand/didn’t find what other block to use, or how to handle this logic.
Doesn’t help that I’m a total noob.

Could you help me with this? I know I’m missing something completely stupid.

I didn’t try it but I like this idea, could be difficult to give it a precise value but it’s a wonderful “Plan B” approach. I didn’t think of that.

First of all, thanks for your… input.
Yeah, I’m sorry, I love bad puns.

I tried this, like you can see in the image below this post, but i think i’m again missing something, because the character moves only 1 pixel per button press (even by holding the button).
I think it’s the Scale Value giving me problems, but at the moment I wouldn’t know how to connect this in a different way.