How to Rotate my spaceship on the Y axis or turn it around but not right around like half using the horizontal
So i want my space to turn around or rotate on the Y axis i trying this code
this is from the unity learn spaceshooter tutorial
rigidbody.rotation = Quaternion.Euler (0.0f, 0.0f, rigidbody.velocity.x * -tilt);
i know this rotate on the z axis but i change the script to rotate on the y axis
but the rotate keep going back to the forward position how i can get to turn the spaceship and still using horizontal to going up. like this game
https://www.youtube.com/watch?v=8par4L8uZXc
and also i can use the raycast from the camera and the input.mouse.position to rotate the space but i am upload the game to mobile and mobile don't have mouses. how can i make it work on the GUI input.touch to rotate.
this Movement script float moveHorizontal = Input.GetAxis ("Horizontal"); float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
rigidbody.velocity = movement * speed;