Compute a random unit vector.
Computes random values for the given vector between -1 and 1 that can be used to represent a direction.
Optionally accepts a scale value to scale the resulting vector by.
name | type | arguments | Default | description |
---|---|---|---|---|
vector | Phaser.Math.Vector2 |
The Vector to compute random values for. |
||
scale | number | <optional> | 1 |
The scale of the random values. |
The given Vector.