build and run problem

136795-screenshotunityerrorbuildandrun.png

Hello,
I have a “build and run” problem. I am currently working on a group project for my school. We use GitHub to share the project with each other and Pun2 to do the multiplayer game we are asked to do. The problem is that when I launch my build and run and choose the resolution etc… When I launch my executable, it first displays a window with the Unity logo and the logo of our project on a black background. Until then, everything is normal. But when my game starts, the window disappears, becomes invisible and shows a piece of logo and the red cross to close the window next to it. When I run my executable in full screen it’s the same thing except that for a short while, you can see a Unity error window appear, then the window closes by itself. I hope I have well detailed my problem.

I work on the multiplayer part. So not being able to build and run is very problematic for me. I can’t do any tests. In addition to that I am a beginner so I am not yet very comfortable technically. I checked with one of my group mates and he has the same problem. In addition, on other projects everything works perfectly. I don’t have that problem.

Thank you for your advance answers. :slight_smile:
I hope my English is not too bad. (I helped myself with a translator)

Finally by creating a copy of my project and removing parts of my code. I rapidely found the issue. It’s because of a function that I created to load my settings that I am recording with PlayerPrefs. In fact, the resolution seems to be null.

I was conviced it wasn’t it because as we can see on the screenShot width and heigth have respectively 800 and 600.

And in the documention they use the same example with the same values. So I don’t understand.

That’s my script I use in the settings if you have the time to check it :). But the real problem comes from LoadSettings();

Thank you for yours answers !
And I apologize for my poor english once again.