1234567891011121314151617 |
- private var yRspeed = 1.0;
- private var frik = 0.5;
- private var xRspeed = 0.05;
- private var xRot : float =0.0;
- private var yRot : float =0.0;
- private var rotRand1 :float = 0.0;
- private var rotRand2 :float = 0.0;
- rotRand1 = Random.Range(0, 6);
- rotRand2 = Random.Range(0.5, 2);
- yRot = Random.Range(0.8, 3) * yRspeed;
-
- function Update () {
- xRot = (Mathf.Sin((Time.time + rotRand1) * frik)* (xRspeed * rotRand2) - xRot);
- transform.Rotate ( 0, Time.deltaTime * yRot , 0, Space.World );
- transform.Rotate ( xRot, 0, 0, Space.Self );
- }
|