loading

Unity 스크립트(script)에서 오브젝트(GameObejct) 생성하기

시바 | Unity(유니티) 5.x

2018. 3. 14. 22:58

1
2
3
4
5
6
7
8
9
10
11
//오브젝트를 생성할 좌표
public float x = 0;
public float y = 0;
public float z = 0;
 
public GameObject player; //생성할 오브젝트
 
// Use this for initialization
void Start () {
      Instantiate(player, new Vector3(x, y, z), Quaternion.identity);
}ㅇ


이렇게 코딩 후.


 

이 Player오브젝트를 아래 처럼 끌어다 놓으면 된다.