public void ChoosePlayer() { playerindex = Random.Range(0, playerCollection.Count); GameObject player = Instantiate(playerCollection[playerindex].playerHead, transform, false); GameObject head = player.transform.GetChild(0).gameObject; AddCollider(playerCollection[playerindex].headcolliderType, head); FollowStart followStart = player.GetComponentInChildren <FollowStart>(); followStart.tail = playerCollection[playerindex].playerTail; followStart.CreateTail(); }
private void Awake() { instance = this; }