public class test : MonoBehaviour {
Vector3 po;
// Use this for initialization
void Start () {
po=new Vector3((transform.position.x+GameObject.Find("target").transform.position.x)/2, //取得目的地点和物体坐标之间的中间点
(transform.position.y+GameObject.Find("target").transform.position.y)/2,
(transform.position.z+GameObject.Find("target").transform.position.z)/2);
}
// Update is called once per frame
void Update () {
transform.RotateAround(po, Vector3.up,1f); //绕某节点转动一定度数
}
}