So I was following a GUI Button related tutorial for Unity 5+ and I copy the code on it exactly like it displayed, like this:
void Start ()
{
mainMenu = mainMenu.GetComponent <Canvas>;
startButton = startButton.GetComponent <Button>;
quitButton = quitButton.GetComponent <Button>;
}
but, unlike the tutorial, I get this error:
I dont see anything actually wrong with the tutorial nor the code I wrote myself. Why is this happening? Am I missing something?
(They are all stated as public right before void Start, btw. )
Thanks in advance!