x


Rotation Reset

I have a camera look script that it equipped to my characters body so it moves it looks like this

{ 

    if (Input.GetKeyUp (KeyCode.LeftControl)){ // this is changeing from sword to arrows
       if (sword == true){
       sword = false;
       range = true;

         }
       }



    if (Input.GetKeyUp (KeyCode.LeftControl)){ // this is changeing from arrows to sword
       if (range == true){
       range = false;
       sword = true;

    }
       }


    if (Input.GetKeyDown (KeyCode.LeftShift))
    shift = true;

    if (Input.GetKeyUp (KeyCode.LeftShift))
    shift = false;
    if (shift == true){
    if (range == true){
    if (axes == RotationAxes.MouseXAndY){
    {
       //float rotationX = transform.localEulerAngles.y + Input.GetAxis("Mouse Y") * sensitivityX;

       rotationX += Input.GetAxis("Mouse Y") * sensitivityX;
       rotationX = Mathf.Clamp (rotationX, minimumX, maximumX);


       rotationY += Input.GetAxis("Mouse X") * sensitivityY;
       rotationY = Mathf.Clamp (rotationY, minimumY, maximumY);

       transform.localEulerAngles = new Vector3( rotationY,rotationX, 0);

          }
}
}
}
    if (shift == false){
       // what do i add here so i can change the rotation back to normal???
    }

}

I commented where i need help. I want to get the objects rotation back to 0,0,0. as if the whole look at camera never happend.

more ▼

asked Nov 06 '11 at 01:17 AM

Babilinski gravatar image

Babilinski
119 40 42 43

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5272
x2245
x337
x171
x28

asked: Nov 06 '11 at 01:17 AM

Seen: 642 times

Last Updated: Nov 06 '11 at 01:17 AM