728x90 유니티2 유니티 - 카메라 플레이어에게 고정하기 [FollowPlayer.cs] using System.Collections; using System.Collections.Generic; using UnityEngine; public class FollowPlayer : MonoBehaviour { public GameObject player; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { transform.position = player.transform.position + new Vector3(0, 1.5f, -8) ; } } Player 값을 줄 때에는 오른쪽에 아주 작은 동그라미가 보.. 2021. 11. 28. 유니티 - 가장 기본적인 위치 이동 [Basic_Move.cs] using System.Collections; using System.Collections.Generic; using UnityEngine; public class Basic_Move : MonoBehaviour { public int Speed; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { if( Input.GetKey (KeyCode.LeftArrow) ){ transform.Translate ( Vector3.left * Speed * Time.deltaTime ); } if( Input.GetKey (Key.. 2021. 11. 28. 이전 1 다음 728x90