using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/*by Alexander*/
//相机跟随脚本
public class CameraTracker : MonoBehaviour
{
public Transform playerTransform;//跟踪的对象
private Vector3 offset;
void Start()
{
// 当前位置 物体的位置
offset = transform.position - playerTransform.position;//计算相对距离
}
void Update()
{
transform.position = playerTransform.position + offset; //保持相对距离
}
}