Search Unity

[Unity 5.6+][Download] Adaptive Full Browser Window template

Discussion in 'Web' started by The_BenEvans, Dec 29, 2016.

  1. The_BenEvans

    The_BenEvans

    Joined:
    Jul 31, 2012
    Posts:
    139
    Hey all,

    Been trying to get WebGL to fit the entire browser window (without scrollbars) recently. Found some old versions around the web that didn't seem to work in the 5.6 beta. So I've managed to make a working template.

    Hopefully this is helpful to someone!

    Installation
    Just download, import into Unity and select "FS_Adaptive" in the Player Settings under "Resolution and Presentation".

    upload_2016-12-29_13-7-59.png

    upload_2016-12-29_13-7-13.png

    Known Issues
    Console sometimes shows
    Code (CSharp):
    1. Could not extract GUID in text file projectsettings/projectsettings.asset at line 44.
    Doesn't cause any issues as far as I can tell... but use caution. I'll update this if I manage to find out the cause.

    WebGL Runtime - Dynamically maintaining browser window dimensions
    upload_2016-12-29_13-1-54.png upload_2016-12-29_13-2-6.png
     

    Attached Files:

  2. dinah93

    dinah93

    Joined:
    Jun 29, 2015
    Posts:
    1
    This should be one of Unitys default options.
    Thanks a lot!
     
  3. daono

    daono

    Joined:
    Nov 29, 2016
    Posts:
    1
    Works flawlessly in unity 2017.2.0f3
    Thank you very much!
     
  4. The_BenEvans

    The_BenEvans

    Joined:
    Jul 31, 2012
    Posts:
    139
    Great to hear!
     
  5. GDevTeam

    GDevTeam

    Joined:
    Feb 14, 2014
    Posts:
    90
    Thanks The_BenEvans. This works great on Unity 2017.3.0b11.

    I was wondering. What if I wanted to show an image first (would load fast, give user something to see while waiting on my WebGL stuff). Do you have some lying around to show how to have an image over the WebGL player then disappear on WebGL load(ed)?

    This way I can speed giving them something to look at (like directions) while loading my application for them.
     
  6. alxcancado

    alxcancado

    Joined:
    Aug 17, 2013
    Posts:
    13
    Im using Unity 2017.3.1f1 and I can't make it work just like in your photos...

    My game should use "portrait" resolution like yours but seems it is not working in mac browsers... tried in Chrome and Firefox.

    Am I missing anything here?

    Screen Shot 2018-02-23 at 16.16.16.png Screen Shot 2018-02-23 at 16.21.49.png