CameraFollow
-
MiniRPG_카메라 추적(CameraFollow)Unity(유니티) 2022. 3. 26. 00:06
using System.Collections; using System.Collections.Generic; using UnityEngine; public class CameraFollow : MonoBehaviour { // 추적 타겟 public Transform target; // 추적 시 이동 보간 public float smoothing = 5f; // 카메라와 추적 대상간의 간격 Vector3 offset; // Use this for initialization void Start() { // 추적 대상과 카메라간의 거리를 측정함 offset = transform.position - target.position; } // Update is called once per frame void Late..