public class CameraFollow : MonoBehaviour
{
public Transform target;
public float smoothing = 5f;
Vector3 offset =new Vector3(1,15,-22);
Transform mTrans;
void Start ()
{
mTrans = transform;
mTrans.eulerAngles = new Vector3(30,0,0);
}
void FixedUpdate ()
{
Vector3 targetCamPos = target.position + offset;
mTrans.position = Vector3.Lerp (transform.position, targetCamPos, smoothing * Time.deltaTime);
}
}
简单相机跟随
最新推荐文章于 2024-08-21 17:25:45 发布