Hello im making a simple trivia game and im trying to remain the gameobject active when the correct answer is clicked. The problem is the correct answer is active only for a second then is inactive then the next answer is active. How can I get it to remain active when gameobject is chosen no matter the time limit?
Game Manager Script
public GameObject[] anw;
int index;
private float timeBtwAct;
public float startTimeBtwAct;
public float actWait;
void Start()
{
timeBtwAct = startTimeBtwAct;
for (var i = 0; i < anw.Length; i++)
anw*.SetActive(false);*
}
void Update()
{
if (timeBtwAct <= 0)
{
index = Random.Range(0, anw.Length);
for (var i = 0; i < anw.Length; i++)
anw*.SetActive(false);*
anw[index].SetActive(true);
timeBtwAct = actWait;
}
else
{
timeBtwAct -= Time.deltaTime;
}
}
GameObject script function when clicked
void OnMouseDown()
{
gameObject.SetActive(true);
AudioSource.PlayClipAtPoint(clip, transform.position);
GetComponent().enabled = true;
}