Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question [Unity6_WebGL_Mobile_iOS] How to remove the white progress bar?

Discussion in 'Unity 6 Beta' started by lastcode, Apr 3, 2024.

  1. lastcode

    lastcode

    Joined:
    Sep 3, 2012
    Posts:
    10
    Hello!
    How to remove the white progress bar at the bottom, or make it work the second time, this can be done for the iOS build, but there is no such option in WebGL?
    Thanks.
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,974
    You can modify the HTML template container for the webgl app. This progress bar is handled on the JS side of things.
     
  3. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,100
    This is the iOS home indicator. You cannot influence it from HTML, only avoid it. Even with native apps, you only have limited ways to influence it (the hiding option is intended for non-interactive content and a bad fit for games, you can only defer system gestures to make it a bit more transparent).

    Not sure if Screen.safeArea works properly in WebGL. You could edit the HTML template to shrink the game view using HTML/CSS.
     
    Ryiah likes this.
  4. lastcode

    lastcode

    Joined:
    Sep 3, 2012
    Posts:
    10

    What you gave there are recommendations for shifting content to other coordinates.
    If I slide the bottom panel up there will be a black bar at the bottom and the game screen will be smaller or I will have to change the buttons

    If you could lock the orientation of landscape mode on an iOS iPhone, you could flip the screen so that this bar was at the top. But on an iPhone, you can only lock portrait orientation, and you can’t lock landscape orientation.

    Because of this indicator there are a huge number of problems, has Unity really not solved this problem for Webgl assemblies?
     
  5. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,100
    There's nothing Unity can do. The home indicator is a system-wide UI on iOS and Apple provides no APIs to completely hide it. This is an UX decision by Apple, every iOS app has to accommodate the home indicator in some way.

    The only option for native iOS games is to make it slightly more transparent. For WebGL, the APIs are further limited and you cannot control the home indicator in any way. Even for PWAs, which have an extended API and are allowed to appear more native, there's only an option to control the status bar, not the home indicator.

    Until Apple adds the necessary APIs, which I'm highly doubtful they ever will, you can only change your UI to accommodate the home indicator. This is the same for anything that runs on iOS.
     
    Neonlyte and Ryiah like this.
  6. lastcode

    lastcode

    Joined:
    Sep 3, 2012
    Posts:
    10

    https://defensezone.net/video_2024-05-02_11-49-35.mp4

    Watch the video, in this example I can use the bottom interface of my game and the indicator is not activated, but if I try to move the indicator 2 times, it is activated.

    This option is available in the Unity build so that the indicator is activated only after clicking again.
    Can Unity make the same option in the WebGL build?
    or maybe you can enable the same option in browsers for iOS?
     
  7. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,100
    This is the defer system gestures option I mentioned before.

    As I said, there are no options to influence the home indicator available to WebGL. The home indicator is the way it is and you can't change it. Unity cannot do anything, either, because Apple hasn't added the Web APIs to do so. Unless Apple adds the necessary APIs, there's nothing that can be done.
     
    lastcode likes this.