# Isometric movement seems faster horizontally

I have an orthographic camera with (30, 45, 0) rotation. The problem is that the player seems to move faster left or right than up or down. Maybe I could divide the horizontal velocity? I don’t know by how much though.

Let’s first figure out if he’s actually moving faster or it just seems that way, can you view the player speed at run time?

What’s the game and what’s your movement code?

I’ve just checked and the player moves with equal speed in all directions. The movement also looks fine in a perspective camera. So it’s not really faster, it just looks that way.

There is an isometric camera and the player moves with WASD. The movement code:

``````public class PlayerController : MonoBehaviour
{
[SerializeField] CharacterController charController;
[SerializeField] float speed;

Vector2 input;

void OnMove(InputValue value)
{
input = value.Get<Vector2>();
}

void Update()
{
var move = new Vector3(input.x, 0f, input.y);

var matrix = Matrix4x4.Rotate(Quaternion.Euler(0f, 45f, 0f));
move = matrix.MultiplyPoint3x4(move);

charController.Move(move * speed * Time.deltaTime);

if (move != Vector3.zero)
{
transform.rotation = Quaternion.LookRotation(move);
}
}
}
``````

Really?, how did you check?
Because looking at your code you’re gonna have the problem that you move diagonally faster than just horizontally or vertically, you need to normalize the “move” vector.

I logged the character controller velocity in Update() It is a problem with how the isometric camera sees things because the speed looks fine in the perspective one.

That’s not the issue, the input is normalized in the input system.

That’s how geometry works. If you move at constant speed in 3d space, then for orthographic camera at angle movement relative to screen will be slower in vertical direction.

There are two simple ways you can convince yourself about it. Draw axis parallel square on the ground. You will see that one diagonal is much longer than the other one. So traveling on both diagonals is same distance 3d space (because it is a square) but for camera one of the directions looks compressed and as a result slower speed.

Slightly different way you can think about it is by considering what happens in the edge cases. If the orthogonal camera was fabing straight down like a topdown camer (let’s call it 0 degrees angle) movement in both direction will look like they have same speed. If camera where facing horizontally (90 degrees) movement sideways will still have the same speed, but movement “up and down” will result in movment into and out of the screen, but since there is no perspective it will look like nothing happens. At 89 degrees “up and down” will still result mostly in into/out of screen movement but with slight movement up and down relative to screen. Closer the camera angle is to 0 degrees facing downward the bigger portion of 3d movement will happen relative to vertical screen axis.

If you apply little bit of basic high school math you can calculate the at the vertical movement relative to screen will be `cos(angle)` of the movment in 3d space along the corresponding axis. If you want constant movement speed in screen space instead of constant speed in 3d space you will need to divide the movement along the corresponding axis by that. In your case probably cos(30) or cos(90-30) depending on whether 0 degrees is considered fully vertical or fully horizontal.

Whether you should compensate for the camera angle and adjust the movement speed so that it’s constant in screen space will depend on your game design choices. Plenty of isometric games use constant movement speed in 3d space, and there are also plenty that have constant speed in screen space (often because they are actually 2d games using isometric sprites and that’s the easier to do instead of intentional choice). If you have constant speed in screen space that may result in some weirdness which can have impact on gameplay. If you allow rotating camera around vertical axis it will be possible to increase travel speed across level by strategically changing camera angle which would be somewhat weird. There some games like fez which intentionally take this effect to extreme as puzzle game mechanic. Another weirdness will come if you have something like circular area effects happening (which look like ellipsis in orthographic camera) . The player will be able to run to the edge of circle and dodge the effect in vertical direction faster than horizontal one.

Slightly different approach which avoids the visual movement speed differences is having main movement directions match with 3d world axes (diagonal in screen space). This may seem slightly weird but depending of the level design most of the walls and most common walking direction can be diagonal anyway, making it less weird. Whether diagonal movement is a problem will depend on the style of game. It might be more of a problem for more action oriented games, less of problem in slower pace puzzle games. But in case of something like platforming where you have to jump across a gap having movement aligned with axis of level geometry might even make things easier.

As for why it’s not a problem with perspective camera. I can’t tell for sure. Part of the geometrical effects and reasoning still apply. I think it’s just we are so used to looking at things with perspective in real world that our brains perceive it differently and compensates for it. Just like those illusions where things look darker in the shadow even though they are the same pixel color in image.

4 Likes