Hello, I made a huge mistake.
I named one of my script “Screen” but it’s a class used by unity.
When I saw my error I immediately delete the script, it was too late…
Do you know how I could fix that ?
It’s my very first game, I was proud of it and I can’t work on it anymore, I know that there is a solution but I can’t find it anywhere.
I always have an error, because I use screeen.height and screen.width and now I receive the message “Screen doesn’t contain a definition for height”.
I really need your help, I just ruined several weeks of work.
Using the class names that Unity uses is not a mistake. But it is needed to be careful when using it because the compiler can confuse where to use which. In your case, the compiler thinks that the Screen class is the class you wrote. You can say that Unity should use its own Screen class like that:
int width = Screen.width;
// change the line with below line:
int width = UnityEngine.Screen.width;
If you will only use Unity’s Screen class in that script, you can add the following to the beginning of your script instead of the above method:
using Screen = UnityEngine.Screen;