3. 카메라 플레이어 따라다니기
새로운 C# 스크립트를 작성한다. using System.Collections; using System.Collections.Generic; using UnityEngine; public class CameraBehaviour : MonoBehaviour { [Tooltip("카메라가 바라보는 오브젝트")] public Transform target; [Tooltip("카메라와 목표 사이의 거리")] public Vector3 offset = new Vector3(0,3,-6); // Update is called once per frame void Update() { // 목표가 올바른 오브젝트인지 확인 if(target != null){ // 목표와의 거리를 두고 카메라 위치 설정 transform...
유니티
2023. 6. 5. 17:53