hi, i’m trying to rotate a 2d sprite (i’m using just a triangle) with only one button (as the title says) . i’ve been only able to transform to a specific position but couldn’t like make it always rotate from 0 to 90 to 180 to -90 and return to 0

You sugget you use Euler Angles instead of rotation. your code would look something like

if (Input.GetKey(KeyCode.R)) {
     Vector3 rot = transform.eulerAngles;
     rot.z++;
     transform.eulerAngles = rot;
}