public Transform hero;//要跟随的物体
private Vector3 offset;
// Use this for initialization
void Start () {
offset = transform.position - hero.position;
}
// Update is called once per frame
void Update () {
transform.position = offset + hero.position;
}