# Move Speed is faster on diagonal movements

After adding my movement script in godot. It seems the move speed is a lot faster when moving diagonally. (IE. up and to the right or down and to the right(left)). Just wondering what is causing this as the velocity doesn’t show an increase other than it showing both the x and y vector.

thank you,

1 Like

I haven’t done this course yet, but could it be that it sees the move as one move unit?

Diagonally would be a slightly longer distance than any of the cardinal directions, so if it sees the movement as one move unit, it would traverse that slightly longer distance in the same time span as a cardinal direction move?

If it makes sense?

1 Like

I did end up finding out why it does it on another forum. It seems it has something to do with the way vectors are calculated and using the two numbers on a diagonal ends up adding about 40% more move speed. I have to normalize something to make it work properly. I don’t fully understand it all yet so I’m continuing on until I have completed this section.

2 Likes

Hi Slothmonger,

You are actually pretty correct its about 41% increase.
When you finally calculate the movement you need to normalise the velocity and then multiply by speed.

direction = velocity.normalize()
move_and_slide(direction * speed)

This would limit the velocity to a value between 0 and 1

I found this thread on reddit that may help the understanding a little better