Disabling the Z axis?

Hello,

i have Created a Sphere with a texture on it.

The texture shows multiple pictures and the user is able to rotate the sphere left and right, and up and down…is there a way i can lock the Z axis’ rotation to zero, so my rotation doesn’t become threedimensional?

here’s my script

var kugel : GameObject;



function Start()
{
	
	


}	
	





function Update () {
	
		if(Input.GetKey("a"))
	{
		kugel.transform.Rotate(0,35*Time.deltaTime,0);
	}
	
	if(Input.GetKey("d"))
	{
		kugel.transform.Rotate(0,-35*Time.deltaTime,0);
	}
	
	if(Input.GetKey("w"))
	{
		kugel.transform.Rotate(35*Time.deltaTime,0,0);
	}
	if(Input.GetKey("s"))
	{
		kugel.transform.Rotate(-35*Time.deltaTime,0,0);
	}
	

}

Instead of using transform.Rotate, consider transform.RotateAroundLocal. It rotates the object around a vector, effectively locking rotation to one axis. Then simply specify Vector3.up, for instance, if you only want to rotate the object around its own y axis.