The screen shot of my error ![alt text][1]
[1]: /storage/temp/79747-screenshot-from-2016-10-08-221541.png
my script which I am getting error
using UnityEngine;
using System.Collections;
public class RotateAround : MonoBehaviour {
public Transform target; // the object to rotate around
public int speed; // the speed of rotation
void Start() {
if (target == null)
{
target = this.gameObject.transform;
Debug.Log ("RotateAround target not specified. Defaulting to parent GameObject");
}
}
// Update is called once per frame
void Update () {
// RotateAround takes three arguments, first is the Vector to rotate around
// second is a vector that axis to rotate around
// third is the degrees to rotate, in this case the speed per second
transform.RotateAround(target.transform.position,target.transform.up,speed * Time.deltaTime);
}
}
↧