Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Issue when toggle to full screen in web player

Discussion in 'Editor & General Support' started by GNR Studios, Apr 18, 2014.

  1. GNR Studios

    GNR Studios

    Joined:
    Apr 18, 2014
    Posts:
    2
    Hello! I am having a issue when toggle to full screen in web player. I toggle to full screen by this script:
    Code (csharp):
    1.  
    2. #pragma strict
    3.  
    4. var fullScreenButton : KeyCode;
    5.  
    6. function Update()
    7. {
    8.  
    9.     if(Input.GetKeyDown(fullScreenButton))
    10.     {
    11.         Screen.fullScreen = !Screen.fullScreen;
    12.     }
    13. }
    14.  
    Apparently, all right, but I can only switch between windowed mode and full screen once, then when I activate the full screen and back to windowed mode, I cannot go back to full screen.
    Thank you for your attention!
    Sorry of my english :p
     
  2. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Is the problem that the key press isn't detected, or the code to change to fullscreen and back doesn't work. I guess you set fullScreenButton somewhere. Be worth adding a Debug.Log inside the if.
     
  3. GNR Studios

    GNR Studios

    Joined:
    Apr 18, 2014
    Posts:
    2
    Hi Graham! I already used the debug.log, and always switch between true and false variable to check the full screen, and the executable for Windows works fine.
    Thank you for you time xD