hello, I am trying to rotate my game object on mouse click, for 90 degrees but it doesn’t work !!!
using UnityEngine;
using System.Collections;
public class TurnCam : MonoBehaviour {
public GameObject gOb;
//private float smoth = 1f;
//private Vector3 targetAngle;
//private bool isTurned;
private int turnedDeg;
// Use this for initialization
void Start () {
//turnedDeg = 0;
}
void OnMouseDown()
{
for (int i = 0; i <=90;)
{
gOb.transform.Rotate (Vector3.up, 1);
i = i + 1;
}
}
// Update is called once per frame
void Update () {
}
}