using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Follow: MonoBehaviour {
//需跟随的物体
public Transform Object;
//差值
public Vector3 vec;
void Start () {
//相机和人物之间的差值
vec = transform.position - guai.position;
}
void Update () {
Go();
}
/// <summary>
/// 相机跟随
/// </summary>
public void Go()
{
//人物加上差值等于相机的位置
transform .position = Object.position + vec;
}
}