using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class statroll : MonoBehaviour {
public void RandomizeStats() {
for(int x = 0; x < 20; x++)
{
int str = 0, agi = 0, inte = 0;
int statroll = Random.Range(1,3);
switch (statroll)
{
case 3:
str++;
break;
case 2:
agi++;
break;
case 1:
inte++;
break;
default:
Debug.LogError("Something went wrong, probbably with my Random.Range bounds!");
x--;
break;
}
Debug.Log("str=" + str + " :agi=" + agi + " :inte=" + inte);
}
}
}
I’m trying to make a Onclick function, but every time I try to put a public text or a public button it says it’s incorrect. I already put a public void, but I’m even sure if that’s in the right place either.