I haven’t been able to find anything useful on this considering I don’t know how to look for it, but I was told to make a singleton for my code since I needed a variable that could be used on another script since the variable is being changed. But when I use it on another script it does not produce the same number since it is static. So basically the first code is:
public int itemNumber;
static public classname instance;
void Start()
{
itemNumber = Random.Range (0, 7)
}
And in the other script I try to use whatever number itemNumber generated by doing:
public int itemNumberTwo
SpinWheel.instance.itemNumber = temNumberTwo
But when I run the script it later does not result in the same numbers I’m guessing because it is static. I try to remove that part but then it says an object reference is needed to access the non-static field. Any ideas? Sorry if the way I tried to explain this doesn’t make sense don’t know a bit of C# mostly just java.