Smooth 90 Degree Rotation like in Temple Run?

Hello Everybody,
im trying to make a smooth 90 degree Rotation like in Temple Run. At the moment, im having an instant 90 degree rotation, but it has small deviations if i rotate multiple times. Thanks for your help!

My Code:

// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
    // Tilt the Player from Left to Right
    transform.Translate(Input.acceleration.x * Time.smoothDeltaTime * tiltSpeed);
    // Move the Player Forward
    transform.Translate(Vector3.forward * moveSpeed * Time.smoothDeltaTime);

    // Make the Player turn
    if (Input.touchCount > 0)
    {
        Touch touch = Input.GetTouch(0);
        switch (touch.phase)
        {
            case TouchPhase.Began:
                startingPosition = touch.position.x;
                playerRotationY = transform.rotation.y;
                break;
            case TouchPhase.Ended:
                if (startingPosition > touch.position.x)
                {
                    playerRotationY = transform.rotation.y + 90;
                    transform.Rotate(0, playerRotationY , 0);
                }
                else if (startingPosition < touch.position.x)
                {
                    playerRotationY = transform.rotation.y -90;
                    transform.Rotate(0, playerRotationY, 0);
                }
                break;

        }
    }
}

}

transform.rotation is a normalized Quaternion so you will not be getting degrees from transform.rotation.y. You are looking for transform.eulerAngles.y which is the transform rotation in degrees.