๐จ๐ผ๐ป๊ฐ๋ฐ/์ ๋ํฐ
์ ๋ํฐ - ์นด๋ฉ๋ผ ํ๋ ์ด์ด์๊ฒ ๊ณ ์ ํ๊ธฐ
Janger
2021. 11. 28. 03:40
728x90
[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 ๊ฐ์ ์ค ๋์๋ ์ค๋ฅธ์ชฝ์ ์์ฃผ ์์ ๋๊ทธ๋ผ๋ฏธ๊ฐ ๋ณด์ด๋๋ฐ ๊ทธ๊ฑฐ ๋๋ฅด๋ฉด ์ค๋ธ์ ํธ ๋ฆฌ์คํธ๊ฐ ๋์ด ๊ฑฐ๊ธฐ์ ํ๋ ์ด์ด๋ฅผ ํด๋ฆญ.
์ถ์ฒ:
https://luv-n-interest.tistory.com/675
์นด๋ฉ๋ผ ํ๋ ์ด์ด์๊ฒ ๊ณ ์ ํ๊ธฐ, Unity 3D
GameObject๋ ์์ง์ด๋๋ฐ ์นด๋ฉ๋ผ๋ ์์ง์ด์ง ์๋ ๊ฒฝ์ฐ๊ฐ ์๋ค. ๊ทธ๋ด ๋ ์ด๋ป๊ฒ ํด์ผํ ๊น? ๋ง์น ์ด๋ ๊ฒ.. Main Camera๋ฅผ ์ด๋ป๊ฒ์ข ํด์ผ๊ฒ ์ง..? ๊ทธ๋์ ์คํฌ๋ฆฝํธ๋ฅผ ํ๋ ๋ง๋ค์. "FollowPlayer"๋ผ๊ณ ์ด๋ฆ์ง์ด
luv-n-interest.tistory.com
728x90