unity rotate object with rigidbody code example
Example 1: how to rotate object unity
public Transform Position; // make reference in inspector
Position.Rotate(x, y, z);
Example 2: how to randomly rotate rigidbody of object in unity
public float speed; private Rigidbody2D rigidbody2d; void Start() { rigidbody2d = GetComponent<Rigidbody2D>(); rigidbody2d.angularVelocity = Random.value * speed; }