Search Unity

Discussion Unity WebGL on Mobile Devices

Discussion in 'Web' started by ronchito, Feb 18, 2023.

  1. ronchito

    ronchito

    Joined:
    Dec 4, 2013
    Posts:
    12
    I am aware of the following statement at the official Unity WebGL documentation, but still wonder about it:

    "Unity WebGL doesn’t support mobile devices. It might work on high-end devices, but current devices are often not powerful enough and don’t have enough memory to support Unity WebGL content."

    This statement appeared in the documentation of Unity 5.3 (and is still there in Unity 2023), and I'm sure that browsers and mobile devices evolved a lot during these ~8 years.

    But, I see that some games (made in Unity WebGL) do work properly in (various) browsers on android and iOS.
    My app (I'm using the devices camera and ML modules) works well on old Android devices (4 years old) but doesn't work on newer Android devices and the newest iPhones, and iPads at all.

    1. How come old android phones are „more powerful“ than the latest iOS devices?
    2. Are there any specific known limitations (packages) that couldn't work on some mobile devices?
    3. Does Unity plan to officially support WebGL on mobile devices in the future?
     
    Last edited: Feb 20, 2023
    makaka-org likes this.
  2. arjuniscool0204

    arjuniscool0204

    Joined:
    May 16, 2017
    Posts:
    14
  3. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,043
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,882
    Those device are not „more powerful“ just because newer Apple devices won‘t run the app. It just tells you that you have a broken iOS build and you need to debug what the cause of that is. Check console logs. It may be an incompatibility with Safari/Webkit, a violation of terms enforced by iOS, trying to use a feature that is not or no longer supported on iOS.
     
  5. menguzar

    menguzar

    Joined:
    Jan 31, 2022
    Posts:
    10
    why can't unity use an established framework like three or babylon to export webgl content? or, barring that, create a web-native framework for its player?

    the capabilities and limitations seem about the same with unity's webgl player, but they DO work on mobile, and are quite performant too.

    Unity's problem with WebGL builds seem to lie mainly in the player itself.

    I'd like to find out what people think about this.
     
  6. unityruba

    unityruba

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    271
    The reason is because we're offering people the capabilities of the Unity engine, which can do *a lot*, and we're converting that to something that can run in a web browser. That has a cost, of course. It works for some use cases, but not others, which would benefit from using something like three.js and such.
     
    makaka-org likes this.
  7. makaka-org

    makaka-org

    Joined:
    Dec 1, 2013
    Posts:
    1,023
    I tested with Unity 2022.3.7, iPhone XS Max, Samsung Galaxy A71. WebGL works.
    Moreover, the New Input System declares here that sensor (accelerometer, gyro, etc.) support for WebGL on Android and iOS devices is available in Unity 2021.2.

    So it works, and I recorded a video tutorial about building and testing for Mobile WebGL.

    > Complete Article with all Links and Commands <

     
    VirtualDawn and siddharth3322 like this.