- Home /
 
How to check if fullscreen on or off?
Hello, iam wondering how i can check if fullscreen is on or off in the script eks:
i need helo with the part above i dont know how the game can check if its on or off :p if(screen.fullScreen = true) <<<----- this part { print("fullscreen is on"); } else { print("fullscreen is off"); }
Answer by perchik · Sep 06, 2013 at 02:02 PM
Hmm, this is another question that google would solve, if you just searched for check fullscreen Unity.
Anyway, your code is mostly correct, Look at Screen.fullScreen in the docs, then you just have to use == instead of =:
 if(screen.fullScreen == true)
 {
     print("fullscreen is on"); 
 }
 else 
 { 
    print("fullscreen is off"); 
 }
 
               Although, here's a pro-tip for you. If you're ever checking to see if something == true in an if statement, you can just put that variable.
ie if(Screen.fullScreen) is just a cleaner way to write if(Screen.fullScreen == true)
That awkward moment when you chastise someone for not checking Google and then become the top hit on Google...
I was just about to post... "Funny, I googled and it brought me here". Then I noticed your comment Frenchie92, lol. Good to see this is all still true in 2020. Also, the OP was so close he just needed == instead of =. #TheIrony
Your answer
 
             Follow this Question
Related Questions
Boolean values not behaving as expected. Please Help?! 0 Answers
Problems with save 1 Answer
true and false wont work! 4 Answers