using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RandomRotate : MonoBehaviour
{
    public float MaxSpeed = 10f;
    public Vector3 RandomRotation = Vector3.zero;
    private Rigidbody body;

    public void Start()
    {
        this.body = this.GetComponent<Rigidbody>();
        RandomRotation = new Vector3(Random.Range(0, MaxSpeed), Random.Range(0, MaxSpeed), Random.Range(0, MaxSpeed));
    }

    public void Update()
    {
        this.body.AddRelativeTorque(RandomRotation * Time.deltaTime, ForceMode.Impulse);
    }
}
