I am trying to make a character controller with 8 direction movement, where it rotates in the direction that it is walking. I have the rotation down, but I need the character to walk forward no matter which input axis is being pressed. This is currently what I have that works, but because I am using addforce twice, it causes the character to move quicker when moving diagonally.
Vector3 velocity = rigidBody.velocity;
Vector3 verticalForce = (Mathf.Abs(Input.GetAxis("Vertical")) * transform.forward * speed) - velocity;
Vector3 horizontalForce = (Mathf.Abs(Input.GetAxis("Horizontal")) * transform.forward * speed) - velocity;
rigidBody.AddForce(verticalForce, ForceMode.VelocityChange);
rigidBody.AddForce(horizontalForce, ForceMode.VelocityChange);