reset transform.rotation

im new to scripting and i was wondering can u reset the transform.Rotate to 0 from a script.

You'd use the identity quaternion:

transform.rotation = Quaternion.identity;

When your transform has a parent, always use localRotation or localPosition.

mainCam.localRotation = Quaternion.identity;
mainCam.localPosition =;

What would I add to this script in order to touch my Android screen with 2 fingers and reset the camera and camera parent to the original Quaternion.identity; and/or or both?

I am super new to scripting and want to create a game where you are underwater and pop bubbles. Attached is a YouTube link of the game and how far I have gotten with the help of Sams Teach Yourself: Unity Game Development and a few YouTube Tutorials. I am using a Raycast and GetTouch script attached to main cam too, to pop the bubbles (aka DestroyObject). I have a lot to learn, but this is where I am at:

using UnityEngine; public class GyroController : MonoBehaviour { private bool gyroEnabled; private Gyroscope gyro; private GameObject GyroControl; private Quaternion rot;
	private void Start () 
		GyroControl = new GameObject ("Gyro Control");
		GyroControl.transform.position = transform.position;
		transform.SetParent (GyroControl.transform);
		gyroEnabled = EnableGyro();

	private bool EnableGyro()
		if (SystemInfo.supportsGyroscope) 
			gyro = Input.gyro;
			gyro.enabled = true;
			GyroControl.transform.rotation = Quaternion.Euler(90f, -90f, 0f);
			rot = new Quaternion(0, 0, 1, 0);
			return true;
		return false;

	private void Update () 
		if (gyroEnabled) 
			transform.localRotation = gyro.attitude * rot;

This script is attached to my main camera. Any help on resetting camera or scene to the original view with 2 fingers touching the screen would be hugely appreciated.

Again, I am super new. I know how to find bits and pieces of what I am after, but need putting it together. For example, I am pretty sure this post answers my question, but how do I use the Original Quaternion.identity to reset my camera view to my current gyro.attitude when 2 fingers tap the screen?

Here is my butchered attempt…

   private OriginalView = Quaternion.identity * gyro.attitude ?
    		if (Input.touchCount = 2)   //or == 2  ??
    			OriginalView = Camera.main.original.rotation (Input.GetTouch (2).position);

Again, I am learning. =(

More info on gyroscopes here… but I do not fully understand which parts I need to reset the camera or how to activate it with touching 2 fingers. Unity - Scripting API: Quaternion

Derek Rieger

PS - Check out my wrist-mounted VR adapter for phones. Made that after a car accident disabled me. Now I want to learn how to make games for it.

See where I’m headed with this? Clear screens… holograms at your fingertips. =) Pretty Please help me learn the C# needed to utilize gyroscopes and touch input!