I’m trying to generate random directions for enemies to move in using this code:
currentDirection = new Vector3(Random.value, 0, Random.value);
currentDirection.Normalize();
However, I really need those two random values to be positive or negative, and to decide randomly between the two. I tried doing
Random.value * Random.Range(-1,1)
for both of those, but it turned out to be giving me directions locked into 45 degree increments.
Is there another way I can get random +/- values into those two spots?
Thanks in advance.