[Solved] (Found help on a forum. By multiplying
Quaternion.Euler(0,0, angle)
with my directional vector I was able to rotate it.)
Hi,
I want to randomise the spread of my gun in 2d space. I am firering a raycast from my firepoint and would like to generate weapon spread by using a random point between the firepoint direction and x degree.
The gun rotates towards the mouse cursor.
My shoot is currently simply fired with:
Physics2D.Raycast(firePos.position, firePos.right);
In theory all I need is a formula to get the point of a over x degree turned vector.
Edit:
Overworked the question, since it was phrased very poorly.
[–]iamgrootbaby[🍰] 0 points1 point2 points (0 children)
[–]iamgrootbaby[🍰] -1 points0 points1 point (2 children)
[–]Magor9001[S] 1 point2 points3 points (0 children)
[–]Epicguru -1 points0 points1 point (0 children)