I am a beginner to Unity Development and came through a task of rotating cube Randomly. I saw many sources but was getting confused about connecting the Cube to the script on Button button click.
Currently, I am doing this:
void Update()
{
transform.rotation = Random.rotation;
}
on the script and adding it to the cube but doing it on button click sounds tricky. Suggestions are appreciated.