I made this
gameobject.transform.Rotate(0,0,Mathf.Cos(Time.fixedTime) * speed, Space.World);
but this will just rotate so smoooothh, I want to shake it faster
I made this
gameobject.transform.Rotate(0,0,Mathf.Cos(Time.fixedTime) * speed, Space.World);
but this will just rotate so smoooothh, I want to shake it faster
[Closed]
This solution works for me
float AngleAmount = (Mathf.Cos(Time.time * speed ) * 180) / Mathf.PI * 0.5f;
Debug.Log("Rotation " + AngleAmount);
AngleAmount = Mathf.Clamp(AngleAmount, -15 , 15 );
material.transform.localRotation = Quaternion.Euler( 0,0, AngleAmount);