I am following this tutorial on 2.5d perspective:
The author mentions and demonstrates that the movement is not in sync when the orthogonal camera is in 45 degrees.
When I press the up arrow I want to move 1/2 speed in the x axis and half speed in the z axis. I'm having difficulty fighting an elegant way to achieve this.
It works somewhat if in the velocity calculation section of the code in the video I do:
if direction_ground.x != 0:
velocity = Vector3(
direction_ground.x * speed/2 + direction_ground.y * speed/2,
velocity_y,
direction_ground.y * speed/2 + direction_ground.x * speed/2)
elif direction_ground.y != 0:
velocity = Vector3(
direction_ground.x * speed/2 - direction_ground.y * speed/2,
velocity_y,
direction_ground.y * speed/2 - direction_ground.x * speed/2)
The above makes sideways movement work correctly. Diagonal unhandled still
But, I'd prefer to not use this inelegant system with if's.