I need two random numbers in a specified interval. I generate them inside a method using the Unity random class . After the first generation everytime I call the method the numbers don’t change. How can I make them change every time i call the method?
Sorry for my bad English
Thanks in advance
You would need to post some code to be sure, but you might be using the Random incorrectly.
Quoting from the help page:
The random number generator is not truly random but produces numbers in a preset sequence (the values in the sequence “jump” around the range in such a way that they appear random for most purposes).
See here for more details.
void Start() { int posX = Random.Range(xmin, xmax); int posZ = Random.Range(zmin, zmax); }
This is the method.
I’m not sure this is well formatted… If it’s not well formatted, how can I do it?
Sorry for theese silly questions, but I’m new on the forum