turning a spaceship on it side so it can fire all turrents

Working a space game, and have a hard time getting the space ship to turn to 90 degrees in order to let all of it turrets fire at it’s target. i try Quaternion.slerp but i having troubles getting the right from and to Quaternion

Dealing with rotations always makes my brain hurt. In the couple of instances I’ve had to deal with something like your ship, I end up making a gimble system with nested empty game objects…one for roll, one for tilt and one for turn. Here is a simple body of code that rotates 90 degress around the Y axis. The commented out line uses RotateTowards() instead of Slerp() to do the rotation.

public class Rotate90_2 : MonoBehaviour {
	
	Quaternion qStart, qEnd;

	void Start () {
		qStart = transform.localRotation;
		Vector3 v3Euler = transform.localEulerAngles;
		v3Euler.y += 90.0f;
		qEnd   = Quaternion.Euler (v3Euler);
	}
	
	void Update () {
		//transform.localRotation = Quaternion.RotateTowards(transform.localRotation, qEnd, 1.0f);
		transform.localRotation = Quaternion.Slerp (qStart, qEnd, (Mathf.Sin (Time.time)+1.0f) / 2.0f);
	}
}