I have this top-down 2D game & a very simple movement script:
private void Update()
{
Vector2 targetVelocity = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"));
playerRigidBody.velocity = targetVelocity * playerSpeed;
}
(playerSpeed is default 4f, playerRigidBody declared in void Awake())
It works perfectly fine, however, when I am moving diagonal, the character looks faster. As the playerSpeed is 4, I am guessing that, when he is moving diagonals, the playerSpeed is 8 because of x & y combined, both with a value of 4.
So, I decreased the speed to 2 when moving diagonals with another simple script that I can post in a comment if necessary.
But the player looks SO slow now.
How do most games get around this? Should I try the value of 3?
I am sure I could find a number that makes the movement “look right,” but I don’t want to throw around numbers without any guidance, as I want the movement to be consistent.
Thanks.