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.
asked
Nov 06 '11 at 01:17 AM
Babilinski
119
●
40
●
42
●
43