Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

When trying to use "worldMap.pointCloud.Points" my application crashes with an uncaught exception

Discussion in 'AR' started by deets, Aug 21, 2018.

  1. deets

    deets

    Joined:
    Feb 10, 2015
    Posts:
    11
    I'm trying to acces my worldmap after my worldmapstatus has changed to MAPPED.
    I do this by using

    if (_currentWorldMappingStatus == ARWorldMappingStatus.ARWorldMappingStatusMapped)
    {
    Debug.LogFormat("ARWorldMap MAPPED");
    _nativeSession.GetCurrentWorldMapAsync(OnWorldMap);
    }


    My "OnWorldMap" code looks like this


    void OnWorldMap(ARWorldMap worldMap)
    {
    if (worldMap != null)
    {
    //_WorldMap = worldMap;
    Debug.LogFormat("ARWorldMap Assigned");
    worldMap.Save(Path.Combine(Application.persistentDataPath, "myFirstWorldMap.worldmap"));
    Debug.LogFormat("ARWorldMap SAVED");
    if(worldMap.pointCloud.Points != null)
    OnWorldMapPointCloudUpdated(worldMap.pointCloud.Points);
    else
    Debug.LogFormat("Pointcloud.Points is null");
    }
    }


    When I build my application with this code it always crashes when trying to acces "worldMap.pointCloud.Points.
    But the crash doesn't give me much information.

    Anyone who can help me with this?
     
  2. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
    Might be fixed with latest