using System.Collections; using System.Collections.Generic; using UnityEngine; public class CameraFollow : MonoBehaviour { public Transform target; public float smooting = 5f; private Vector3 offset; // Start is called before the first frame update void Start() { offset = transform.position - target.position; } // Update is called once per frame void Update() { Vector3 targetCamPos = target.position + offset; transform.position = Vector3.Lerp(transform.position, targetCamPos, smooting * Time.deltaTime); } }
实现第三视角摄像机跟随
最新推荐文章于 2023-02-02 11:44:09 发布