I have this code that creates random vectors, which are used in the AddForce to push rigid bodies around.
var angle = Random.Range(-WindAngle, WindAngle);
var quaternion = Quaternion.Euler(0, angle, 0);
var newDirection = quaternion * direction;
direction = newDirection;
I also need an arrow that will rotate to show the direction, but i can't get it to work.
I use
Arrow.transform.rotation = Quaternion.LookRotation(windarea.direction, new Vector3(0, 0, 0));
but it rotates on the Y instead of the Z. I tried different vectors, but it just makes it worse.