I am new to Unity, and starting on creating my first simple projects. For some days already I've been facing a problem and doing a ton of research but I still cant get it to work, here is it:
As far as I know, it is a smart idea to have a "GameManager" object with a "GameManager" script that holds the main functions of the game (please correct me if it isn't best practice). So lets put as an example I have Scene 1 and Scene 2:
Scene1: -GameManager -Label
in GameManager there is a function called ChangeLabelText()
Scene2: -Button -Scene2Script
in Scene2script there is a function called ButtonOnClick()
and here is my problem: how do I get ButtonOnClick() to call GameManager.ChangeLabelText()? I always get a reference error.
I've tried to do it within the same Scene and it works perfectly, but not between different scenes. Any ideas?
Thank you !