포톤을 이용한 멀티게임으로 씬 전환하는데 있어서 오류가 나서 막혔습니다.
1. A라는 씬이 있고 B라는 씬이 있으면 A라는 씬에서 B라는 씬으로 넘어갈때 플레이어 클론 2개가 그 씬 그대로 남아있습니다.
이 클론이 다른 씬으로 넘어가서 움직이면 이 복제된? 클론 2개도 같이 움직입니다.
2. 그리고 그 뒤사람이 씬 전환을 하면 먼저 들어간 사람이 보이지만 먼저 들어간 사람은 그 뒤에 온 사람이 보이지가 않습니다.
if (collision.CompareTag("Player") && Input.GetKeyDown(KeyCode.Space) && collision.gameObject.GetComponent<PhotonView>())
{
//StartCoroutine(TeleportRoutine());
//this.audiosource.Play();
//PhotonNetwork.Destroy(player);
//Destroy(player);
Transform[] List = GetComponents<Transform>();
if(List != null)
{
for(int i = 0; i<List.Length; i++)
{
if(List[i] != transform)
{
Destroy(List[i].gameObject);
}
}
}
SceneManager.LoadScene(toMap);
//GameManager.instance.CreatePlayer();
}
이것저것 해봤는데 도저히 모르겠네요.