Search Unity

WebGL build including VR module, which in turn in including Physics module

Discussion in 'Web' started by Nicolas1212, Mar 15, 2018.

  1. Nicolas1212

    Nicolas1212

    Joined:
    Dec 18, 2014
    Posts:
    139
    Hi,

    I'm exporting a WebGL build of our 2D game, and looking at different ways to decrease the amount of memory used.

    Using http://files.unity3d.com/build-report/ it's telling me that the VR module is used in the build ("Required by Scripts"), which in turn is bring in the Physics module. ("Required by VR module"):

    (image embedding doesn't seem to work, but you can see it at https://imgur.com/a/wRKfr)

    We do use Physic2D in the game, but no VR, nor Physics.
    • Is there any way to see which code is including VR, and thus Physics?
    • How can I disable VR in WebGL altogether?
    • Failing that, how can I force exclude both the VR and Physics modules?
    Is it possible that this is related to an update in the UnityPurchasing module?

    > " ## [1.9.0] - 2016-10-31
    - [Beta] Google Play - Support for Daydream VR. Requires Unity 5.4+ "GVR" Technical Preview, enabling VR, and including the Daydream SDK. Additional details [here](https://unity3d.com/partners/google/daydream)."
    Thanks
     
  2. kognito1

    kognito1

    Joined:
    Apr 7, 2015
    Posts:
    331
    Well I'm not sure about the vr portion, but I believe Physics2D is still physx no?
     
  3. Nicolas1212

    Nicolas1212

    Joined:
    Dec 18, 2014
    Posts:
    139
    I was actually under the impression that Physics2D uses Box2D, not Physx. And going by the build log, it's only included because it's required by the VR module
     
  4. Nicolas1212

    Nicolas1212

    Joined:
    Dec 18, 2014
    Posts:
    139
    Okay, so the VR seems to be included because of the Purchasing module, however Physics is still in there, even though it says nothing is requiring it

    https://imgur.com/a/QQqIo
     
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    If using character controller or any colliders, it will include physics.
     
  6. Nicolas1212

    Nicolas1212

    Joined:
    Dec 18, 2014
    Posts:
    139
    Okay, after digging more into it, it turns out the TextMeshPro is the culprit as some of the classes use the BoxCollider and Rigidbody classes, which brings in the Physics library.

    Thanks for the help all!