var rotateSpeed:int = 25; static var pivotPoint:Vector3; static var pivotPointOffset:Vector3; function Update() { pivotPoint = gameObject.transform.position; if (gameObject.transform.localScale.x != 1.0) { pivotPointOffset.x = gameObject.transform.localScale.x / 2; } if (gameObject.transform.localScale.y != 1.0) { pivotPointOffset.y = gameObject.transform.localScale.y / 2; } if (gameObject.transform.localScale.z != 1.0) { pivotPointOffset.z = gameObject.transform.localScale.z / 2; } pivotPoint -= pivotPointOffset; if(Input.GetKey (KeyCode.LeftArrow)) { gameObject.transform.RotateAround(pivotPoint, Vector3.up, Time.deltaTime * rotateSpeed); } if(Input.GetKey (KeyCode.RightArrow)) { gameObject.transform.RotateAround(pivotPoint, - Vector3.up, Time.deltaTime * rotateSpeed); } }