How do I…
Make diagonal movements be the same speed as the straights?
What is the expected result
If you didn’t knew, it’s really common for a top-down movement to be faster while in moving in diagonals. This is because when you move diagonally, you move 1 pixel vertically and 1 pixel horizontally. That means, you move faster in the diagonal.
So, to fix this, I tried doing this, using a mathematical equation to calculate the hypotenuse of this movement:
This is, basically, a² + b² = c²
I don’t know exactly how to explain it, but here’s the video I used as reference: How to fix your diagonal movement! - YouTube
What is the actual result
Nothing happens, basically. The player, as it seems, continues to move faster diagonally.
Related screenshots
- Just to clarify, I am applying these movements on a custom behavior
- The max speed is the same on vertical and horizontal movement
- The default max speed is 2.5
- The acceleration and decceleration are both 0,125