타겟
-
[유니티] 플레이_타겟 위치로 카메라 이동게임 개발 2020. 1. 12. 22:40
처음 게임이 시작됐을 때 타겟 위치로 카메라가 이동하는 스크립트를 작성해보았다. public class Play_camera : MonoBehaviour { public GameObject target; public float cameraSpeed, halfHeight; public Camera cam; public Vector3 targetPosition; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { if (target.gameObject != null) { // target 위치 찾기 targetPosition.Set(this.transf..