Code (CSharp): public class ClassWord : MonoBehaviour { private GameObject [] gameWords; private int randomNum; public Start() { randomNum = Random.Range(0.gameWords.Length) } public void SpawnWord() GameObject go = Instantiate(prefab[prefabNumber], spawnPos) as GameObject; return; } } Public Class GameManager: Monobehaiour{ public float maxTime = 5f; public float timesLeft; pubic GameObject thedeathmenu; void Start () { timerbar = GetComponent<Image> (); timesLeft = maxTime; } void Update () { if (timesLeft > 0) { timesLeft -= Time.deltaTime; timerbar.fillAmount = timesLeft / maxTime; } else { if (timesLeft <= 0){ gmeOverScreen.enable(true); } } } }*/ Code (CSharp): public void OnClickRed() { if (gameObject.CompareTag("red")) ScoreScirpt.scorevalue++; else ScoreScirpt.scorevalue--; EndDisplay.SetActive(true); } public void OnClickYellow() { if (gameObject.CompareTag("yellow")) ScoreScirpt.scorevalue++; else EndDisplay.SetActive(true); } public void OnClickGreen() { if (gameObject.CompareTag("green")) ScoreScirpt.scorevalue++; else EndDisplay.SetActive(true); } public void OnClickOrange() { if (gameObject.CompareTag("orange")) ScoreScirpt.scorevalue++; else EndDisplay.SetActive(true); } public void OnClickBlk() { if (gameObject.CompareTag("black")) ScoreScirpt.scorevalue++; else EndDisplay.SetActive(true); } }*/ for buttond ?Instead of using quiz questions im using prefabs. I am trying to put total of 6 different buttons that stays the entire game. Would like to use game objects and use same tags instantiate loop? Have a total of 36 different prefabs. Not sure how would work put in a "container" and one prefabs starts at awake. Then must click button within amount seconds and if pressed right then would want to change to another prefab. And add score. dd
Any particular reason why you need to cycle through prefabs? It seems like you could just change the values of certain fields, such as the quiz text, and re-evaluate the correct answer every time the question changes.