Hello people. I can’t get Random.Range() to work properly.
I want a random number between 1 and 4.
Depending on the number, a different type of enemy will instantiate.
So here is what:
If I wright
var number = UnityEngine.Random.Range(1,4);
The 4th enemy never spawns.
I read after searching that the last number is never going to happen anyway, so I changed the above line to:
var number = UnityEngine.Random.Range(1,5);
In that case the 4th enemy spawns, but now the 3rd enemy never spawns.
I even tried extending the range the other way around, and I wrote
var number = UnityEngine.Random.Range(0,5);
but that way no enemies will spawn at all.
So please, tell me, how can I actually get random numbers between 1 and 4 ?