private void FixedUpdate() { if (horizontal != 0 && vertical != 0) // Check for diagonal movement { // limit movement speed diagonally, so you move at 70% speed horizontal *= moveLimiter; vertical *= moveLimiter; } playerAnimationController.HandleMovementAnimations(horizontal, vertical); rigidbody2D.velocity = new Vector2(horizontal * player.movementSpeed, vertical * player.movementSpeed); }