i am designing an endless runner game. where i want to show one of the difficuties from an array i have made. i have difficulties 1,2,3 and i am assigning its index each time and want to get them set active. But they become all the indexes or the difficulty level.
I Wrote the following code in Start method.
`
public GameObject[] difficulties;
// Start is called before the first frame update
void Start()
{
int randomDiffi = Random.Range(0, difficulties.Length);
difficulties[randomDiffi].gameObject.SetActive(true);
now I want to make active 1 defficulty level in between 1 and 3. each its needs to be radomly vary not all the difficulties to be loaded as it does.
New contributor
Waheed is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.