I just want a simple Rotation in the Y Axis with random values and have following code:
private void Rotate()
{
rotation = Random.Range(-360.0f, 360.0f);
print(rotation);
Quaternion qRotation = Quaternion.Euler(0, rotation, 0);
print(qRotation);
transform.rotation = Quaternion.Slerp(transform.rotation, qRotation, Time.deltaTime * rotationSpeed);
}
But on Runtime the rotation is not working and the values for the Quaternion is also weird...
![alt text][1]
[1]: /storage/temp/146491-debug.jpg
Even when i put fix flaots into the Quaternion.Euler, the rotation is not happening as the values for the qRotation will alway between 0 and 1...
↧