I have a car that rotates around a cylinder and goes forward (normal driving, but it’s on cylidner). When i press left mouse click the car rotates to the left and when i press right mouse click the car rotates to the right. What i want is when i release the buttons the car should rotate to point forward along the cylinder. (Meaning, that you have to hold left/right buttons to steer, and when released the car should go back to middle)

 rotation  = Input.GetAxisRaw("Horizontal");
     Vector3 yRot = Vector3.up * rotation * rotation_speed * Time.deltaTime;
     Quaternion deltaRot = Quaternion.Euler(yRot);
    Quaternion targetRot = rgb.rotation * deltaRot;
    rgb.MoveRotation(Quaternion.Slerp(rgb.rotation, targetRot, 50f * Time.fixedDeltaTime));

I would suggest you put your car as child in a container GameObject.
Then you only change the localRotation on clicking the mousebuttons.

As soon as you release the key, you can simply set the local rotation to 0 and it should point forward again.

I have infinite cylinders spawning forward, and the car goes forward infinite, it’s a freeride gameplay, so if i add the child in the cylinder it won’t work on the others (cloned ones), could you please write me a code for this so i can try it? Thanks in advance!