Search Unity

SpatialCoordinateSystem is NULL with Master Build

Discussion in 'VR' started by belveder_79, Jun 20, 2019.

  1. belveder_79

    belveder_79

    Joined:
    Jul 26, 2016
    Posts:
    15
    Hi,

    I ran into a very strange problem. We wrote some code to get the SpatialCoordinateSystem from the WorldManager, something like:

    Code (CSharp):
    1.  
    2. Debug.Log("WorldManager state (should be Active): " + WorldManager.state);
    3. SpatialCoordinateSystem spc = Marshal.GetObjectForIUnknown(WorldManager.GetNativeISpatialCoordinateSystemPtr()) as SpatialCoordinateSystem;
    4. Debug.Log("SpatialCoordinateSystem spc is null? " + ((spc == null) ? "true" : "false"));
    5.  
    When we build the application in Debug or Release mode, this works fine. However, as soon as we switch to Master (which we have to do for Store builds), the
    spc
    becomes NULL and the app crashes later on.
    Code (Log):
    1.  
    2. WorldManager state (should be Active): Active
    3. SpatialCoordinateSystem spc is null? true
    4.  
    I don't understand why this happens and how to fix this. Any help is highly appreciated.
    Thx...

    Unity 2017.4.29LTS
    Visual Studio 2017 Community (latest)
    Windows 1809 (building for 17734)
    Hololens Standard Edition (running latest)
     
    Last edited: Jun 20, 2019
  2. belveder_79

    belveder_79

    Joined:
    Jul 26, 2016
    Posts:
    15
    Same happens with this config

    Unity 2018.4.2LTS
    Windows 1903
    Hololens Standard Edition (2019-6B update)
     
  3. belveder_79

    belveder_79

    Joined:
    Jul 26, 2016
    Posts:
    15