The question is answered, right answer was accepted
How to use Random.rotation inside a vector 3? C#
I'm trying to use: public Quaternion randomRotation = Quaternion.Euler(new Vector3(0,0,Random.rotation));
However I get this error, error CS1503: Argument '#3' cannot convert 'UnityEngine.Quaternion' expression to type 'float'
I know why its wrong but I don't know how to fix it. I tried System.Convert... like how you would if you were trying to convert a float to a string.
Answer by mkobaner · Mar 20, 2016 at 10:22 AM
this might work if you can implent
public Quaternion randomRotation; public float x;
//than in update;
x =Random.Range(0,360); // or anyvalue you like
Quaternion randomRotation = Quaternion.Euler(new Vector3(0,0,x));
Follow this Question
Related Questions
Quaternion lerp slowing down movement? 1 Answer
Grabbing the Relative eulerAngles.y of a Rotation 1 Answer
Using quaternions to align game objects. 1 Answer
Look Rotation Viewing Vector is Zero 0 Answers
Look rotation viewing vector is zero 1 Answer