rotating using a reference to the gameObjects y

I’m trying to rotate a Camera game object to the right by referencing game object.

using UnityEngine;
using System.Collections;

public class CameraRotate : MonoBehaviour {
    public float startCameraYRotation;
    public float cameraSpin = .20f;

    void Start(){
        //Note: Here I attempted to spin the camera 
        //gameObject.transform.localEulerAngles = new Vector3(0,cameraSpin , 0.0f);
        //Note: Next Attempt using a reference to the game object
        GameObject gameObject = new GameObject(); getTRotation(ref gameObject);
        transform.localEulerAngles = new Vector3(0,cameraSpin , 0.0f);
    }
    //NOTE: a reference to the game object
    void getTRotation(ref GameObject gameObject){
        //NOTE: Attempting to Change the Y Value in this function
        //NOTE: adds .2f to the y value of game objects transform.rotation.y which should turn the camera (game object) right

        //gameObject.transform.rotation.y += cameraSpin * Time.deltaTime;
        //gameObject.transform.rotation = Quaternion.AngleAxis(cameraSpin, Vector3.right);
        //transform.localEulerAngles.y += cameraSpin * Time.deltaTime;
        //transform.localEulerAngles = new Vector3(0,cameraSpin , 0.0f);
    }
    void Update(){
        if (Input.GetKeyDown (KeyCode.C)) {
        //NOTE:Prints the current value of game objects transform rotation y value
        startCameraYRotation = gameObject.transform.rotation.y;
        Debug.Log (startCameraYRotation);
        } 

    }
}

any ideas

perhaps you can explain what you are trying to do, because that code doesn’t make a huge amount of sense.

How about this

I believe you are trying to do this:

// Inside Update
transform.Rotate( new Vector3(0f,0f,90f) * Time.deltaTime );

It would be a good idea to spend some time with some tutorials.

Check out Codey’s Lab for some help.

Thanks, I will give it a try, and give that a look.

not quite what i wanted, i changed it to transform.Rotate( new Vector3(0f,90f,0f) * Time.deltaTime ); to get the feel of what i wanted but i don’t think i’m going to be able to achieve what I want. Thanks for your help