- Home /
Question by
Gentle-Wolf · Dec 26, 2016 at 09:28 PM ·
rotationrandomspeedrandom.range
Random Speed to an Object Rotation
Hello, I am new to programming and could not find the solution to assigning a random speed to an object rotation. I don't know if it is possible or not.
I have a circle outside of game screen bounds and i want it to rotate in a fixed direction but at random speed which I can modify in the editor.
at the moment i'm using this code -
public class Spawner_Circle_Rotate : MonoBehaviour
{
[SerializeField]
private float rotSpeed;
void Update()
{
transform.Rotate(0, 0, -1 * rotSpeed);
}
}
Comment