using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class SpawnGB : MonoBehaviour { public GameObject gbPlayer; public GameObject[] pfPlayers; public Transform spawnPoint; public int iPlayer; // Use this for initialization void Start () { iPlayer = PlayerPrefs.GetInt("PlayerSelected"); gbPlayer = Instantiate(pfPlayers[iPlayer], spawnPoint.position, spawnPoint.rotation); } // Update is called once per frame void Update () { } public void BackHome() { SceneManager.LoadScene(0); } }