i have a cube which i want to rote right or left on the x axis as shown in the diagram randomly.i have seen the euler angles and the rotation concept and some questions about them but have not found them suitable for my case.my code goes like this
var x:float;
function Start()
{
x=Random.value;
}
function Update()
{
if(x>=0.5)
{
//rotate right
}
if(x<0.5)
{
//rotate left
}
}
so i need the cube to rotate slowly towards right if the value is greater than 0.5 like in the pic attached and similarly for lesser values.Thankyou.
![alt text][1]
[1]: /storage/temp/45346-rot2.jpg
↧