I want to get the value of -1 or 1 randomly.
I know we can use Random.Range(min, max) for this, but if I use -1 and 1, then 0 is of course also included, which I do not want.
What simple method is there to get this right? So far I have done two different ways to overcome this problem. I used 1 and 2 for min and max, and if it’s 1 then I set the value to -1, if it’s something else, then I set the value to +1. The other method is to put the random into a loop, and only quit the loop if the value is not 0.
But I don’t think either of these two solutions are probably a good habit to get into, especially the loop one.
Would appreciate any suggestions. Perhaps there’s an altogether different method?