# Scanning feature stuck at step 4

**URL:** <https://community.nianticspatial.com/t/scanning-feature-stuck-at-step-4/3454>\
**Category:** I'm Stuck\
**Tags:** guidance\
**Created:** [April 11, 2023, 9:45am UTC](https://community.nianticspatial.com/t/scanning-feature-stuck-at-step-4/3454 "2023-04-11T09:45:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![shoib](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@shoib](https://community.nianticspatial.com/u/shoib)\
**Post date:** [April 11, 2023, 9:45am UTC](https://community.nianticspatial.com/t/scanning-feature-stuck-at-step-4/3454/1 "2023-04-11T09:45:34Z")

</div>

_Include the following details (edit as applicable):_

- **Issue category** : Semantic Segmentation / Multiplayer / Real-time Mapping-Depth / ARDK Documentation / Unity Example Package / Sample App aka ‘AR Voyage’ / ARDK Virtual Studio Tools / Developer Tools / Networking / VPS
- **Device type & OS version** : Android / iOS / Other Ex. iPhone 8+ on iOS 13
- **Host machine & OS version** : Mac / Windows / Linux / Other Ex. Mac on Big Sur x.x
- **Issue Environment** : Unity Remote / Unity Mock / On Device / Dev Portal
- **Xcode version** :
- **ARDK version** :
- **Unity version** :

Description of the issue:

m stuck at step 4 at the start method where \_scanManager.OnScanResult += ScanResultHandler; is showing an error at OnScanResult

This is my code  
using Niantic.ARDK.AR;  
using Niantic.ARDK.AR.Scanning;  
using Niantic.ARDK.Extensions;  
using Niantic.ARDK.Extensions.Scanning;  
using UnityEngine;  
using UnityEngine.Events;  
using System.Collections;  
using UnityEngine.UI;  
using System;  
using System.Collections.Generic;

public class ScanningExampleManager : MonoBehaviour  
{  
[SerializeField]  
[Tooltip(“The scene’s ARScanManager”)]  
private ARScanManager \_scanManager;  
// …

```auto
[SerializeField]
private PointCloudVisualizer _pointCloudVisualizer;

void Start()
{
    // Set default visualizer
    _scanManager.SetVisualizer(_pointCloudVisualizer);
    _scanManager.OnScanResult += ScanResultHandler;

}

public void ScanButtonPressed()
{
    _scanManager.StartScanning();
}

public void StopButtonPressed()
{
    _scanManager.StopScanning();
}

public void ProcessButtonPressed()
{
    IScanner.State state = _scanManager.ScannerState;
    if (state == IScanner.State.ScanCompleted)
    {
        // Start processing scan 
        _scanManager.StartProcessing();
    }
}

public Slider _progressBar;

private void Update()
{
    IScanner.State state = _scanManager.ScannerState;

    if (state == IScanner.State.Processing)
    {
        _progressBar.gameObject.SetActive(true);
        _progressBar.value = _scanManager.GetScanProgress();
    }
    else
    {
        _progressBar.gameObject.SetActive(false);
    }
}

public void CancelProcessButtonPressed()
{
    _scanManager.CancelProcessing();
}

private GameObject scannedObject;
private GameObject _scannedObjectPrefab;
public Transform _scannedObjectParent;

private void ScanResultHandler(TexturedMesh texturedMesh, IScanner.State state, Vector3 centerPosition)
{
    if (texturedMesh != null)
    {
        if (scannedObject == null)
        {
            scannedObject = Instantiate(_scannedObjectPrefab, _scannedObjectParent);
        }
        Bounds meshBoundary = texturedMesh.mesh.bounds;
        scannedObject.transform.localPosition = -1 * meshBoundary.center;
        scannedObject.transform.localScale = Vector3.one / meshBoundary.extents.magnitude;
        scannedObject.GetComponent<MeshFilter>().sharedMesh = texturedMesh.mesh;
        if (texturedMesh.texture != null)
            scannedObject.GetComponent<Renderer>().material.mainTexture = texturedMesh.texture;
    }
}

```

}

---

<div class="post-metadata">

**Author:** ![Maverick\_Niantic](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@Maverick\_Niantic](https://community.nianticspatial.com/u/Maverick_Niantic)\
**Post date:** [April 11, 2023, 4:57pm UTC](https://community.nianticspatial.com/t/scanning-feature-stuck-at-step-4/3454/2 "2023-04-11T16:57:21Z")

</div>

Hi shoib,

Unfortunately we haven’t had the chance to update the documentation quite yet. The event you’re looking at has been renamed to `OnScanProcessed` and the individual parameters have been moved to the struct `ScanProcessedArgs` which is part of `IScanner`. I apologize for the confusion!

Best,  
Maverick L.

---

<div class="post-metadata">

**Author:** ![Sadao\_Tokuyama](https://sea2.discourse-cdn.com/niantic/user_avatar/community.nianticspatial.com/sadao_tokuyama/32/316_2.png) [@Sadao\_Tokuyama](https://community.nianticspatial.com/u/Sadao_Tokuyama)\
**Post date:** [April 14, 2023, 8:32am UTC](https://community.nianticspatial.com/t/scanning-feature-stuck-at-step-4/3454/3 "2023-04-14T08:32:49Z")

</div>

Hi Maverick,

Even when I search for OnScanProcessed using API, it doesn’t appear at all. Without sample code using OnScanProcessed, I cannot implement it.

Thanks.

---

<div class="post-metadata">

**Author:** ![ecofler](https://avatars.discourse-cdn.com/v4/letter/e/e47774/32.png) [@ecofler](https://community.nianticspatial.com/u/ecofler)\
**Post date:** [April 14, 2023, 10:31am UTC](https://community.nianticspatial.com/t/scanning-feature-stuck-at-step-4/3454/4 "2023-04-14T10:31:30Z")

</div>

The event name is ScanProcessed, in the ARDK Example Scenes package you can find an example of how it’s used, look for the Scanning scene (which is basically the working reproduction of the scanning framework tutorial).

---

<div class="post-metadata">

**Author:** ![Maverick\_Niantic](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@Maverick\_Niantic](https://community.nianticspatial.com/u/Maverick_Niantic)\
**Post date:** [April 18, 2023, 8:24pm UTC](https://community.nianticspatial.com/t/scanning-feature-stuck-at-step-4/3454/5 "2023-04-18T20:24:16Z")

</div>

The API as of the time I wrote my first response had not been updated either. As @ecofler stated, you can find an example of how to use the new method from within the updated Scanning Framework sample. For more information, refer to the answer to your question here: [https://community.nianticspatial.com/t/where-is-the-mesh-saved-after-scanned/3445/4](https://community.nianticspatial.com/t/where-is-the-mesh-saved-after-scanned/3445/4)

If you have any other questions please feel free to ask them here.

I hope that helps and sorry for the confusion!

---

<div class="post-metadata">

**Author:** ![Sadao\_Tokuyama](https://sea2.discourse-cdn.com/niantic/user_avatar/community.nianticspatial.com/sadao_tokuyama/32/316_2.png) [@Sadao\_Tokuyama](https://community.nianticspatial.com/u/Sadao_Tokuyama)\
**Post date:** [April 19, 2023, 9:59am UTC](https://community.nianticspatial.com/t/scanning-feature-stuck-at-step-4/3454/6 "2023-04-19T09:59:50Z")

</div>

Hi Maverick,  
Thanks for the advice.  
Once implemented with ScanProcessed, the build error no longer occurs.  
However, when it worked, an error occurred during scanning.

Below is a video of it in action.

> **[RPReplay\_Final1681893184.mov](https://drive.google.com/file/d/1TgYbHHnazTVOoKA-JfoxHJYE6djf57Vo/view?usp=sharing)**
>
> Google Drive file.

```auto
using UnityEngine;
using UnityEngine.UI;
using Niantic.ARDK.AR;
using Niantic.ARDK.AR.Scanning;
using Niantic.ARDK.Extensions;
using Niantic.ARDK.Extensions.Scanning;

public class ScanningExampleManager : MonoBehaviour
{
    [SerializeField]
    private ARScanManager _scanManager;

    [SerializeField]
    private PointCloudVisualizer _pointCloudVisualizer;

    [SerializeField]
    private GameObject _scannedObjectPrefab;
    
    [SerializeField]
    private Transform _scannedObjectParent;

    [SerializeField]
    private Slider _progressBar;

    private GameObject scannedObject;

    // Start is called before the first frame update
    void Start()
    {
        _scanManager.SetVisualizer(_pointCloudVisualizer);
        _scanManager.ScanProcessed += ScanResultHandler;
    }

    // Update is called once per frame
    void Update()
    {
        IScanner.State state = _scanManager.ScannerState;

        if (state == IScanner.State.Processing)
        {
            _progressBar.gameObject.SetActive(true);
            _progressBar.value = _scanManager.GetScanProgress();
        }
        else
        {
            _progressBar.gameObject.SetActive(false);
        }
    }

    public void ScanButtonPressed()
    {
        _scanManager.StartScanning();
    }

    public void StopButtonPressed()
    {
        _scanManager.StopScanning();
    }

    public void ProcessButtonPressed()
    {
        IScanner.State state = _scanManager.ScannerState;
        if (state == IScanner.State.ScanCompleted)
        {
            _scanManager.StartProcessing();
        }
    }

    public void CancelProcessButtonPressed()
    {
        _scanManager.CancelProcessing();
    }

    public void SaveButtonPressed()
    {
        _scanManager.SaveCurrentScan();
    }

    private void ScanResultHandler(
        IScanner.ScanProcessedArgs args)
    {
        var texturedMesh = args.TexturedMesh;
        if (texturedMesh != null) 
        {
            if (scannedObject == null)
            {
                scannedObject = Instantiate(_scannedObjectPrefab, _scannedObjectParent);
            }
            Bounds meshBoundary = texturedMesh.mesh.bounds;
            scannedObject.transform.localPosition = -1 * meshBoundary.center;
            scannedObject.transform.localScale = Vector3.one / meshBoundary.extents.magnitude;
            scannedObject.GetComponent<MeshFilter>().sharedMesh = texturedMesh.mesh;
            if (texturedMesh.texture != null)
            {
                scannedObject.GetComponent<Renderer>().material.mainTexture = texturedMesh.texture;
            }
        }
    }
}

```

Below is the Unity Package for my project.  
[https://drive.google.com/drive/folders/1mhRERy6-cqdNqGf3RnRARDCL4wVKyXlZ?usp=sharing](https://drive.google.com/drive/folders/1mhRERy6-cqdNqGf3RnRARDCL4wVKyXlZ?usp=sharing)

If you could give me some advice, I would appreciate it.

Best regards.

---

<div class="post-metadata">

**Author:** ![Maverick\_Niantic](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@Maverick\_Niantic](https://community.nianticspatial.com/u/Maverick_Niantic)\
**Post date:** [April 19, 2023, 11:21pm UTC](https://community.nianticspatial.com/t/scanning-feature-stuck-at-step-4/3454/7 "2023-04-19T23:21:17Z")

</div>

Hi shoib,

Thank you for taking the time to send your Unity package for me to look over. The error I encountered had to do with the `PointCloudVisualizer` lacking an Animation Curve, so I selected the slope curve (curve #2) and from there I was able to run the application, scan, and process it without incident. In order to assist you further, I will need to see the error message you’re encountering. You can find it by connecting your device to your development machine and building and running the application in debug mode. Any errors that occur should pop up in Android Studio or XCode depending on the platform you’re building for. Simply copy and paste the errors into a quote or code block and I will help you out from there.

Thanks,  
Maverick L.

---

<div class="post-metadata">

**Author:** ![Sadao\_Tokuyama](https://sea2.discourse-cdn.com/niantic/user_avatar/community.nianticspatial.com/sadao_tokuyama/32/316_2.png) [@Sadao\_Tokuyama](https://community.nianticspatial.com/u/Sadao_Tokuyama)\
**Post date:** [April 20, 2023, 5:57am UTC](https://community.nianticspatial.com/t/scanning-feature-stuck-at-step-4/3454/8 "2023-04-20T05:57:25Z")

</div>

Hi Maverick,  
Thank you very much for your prompt response.  
I followed your advice and after setting the Animation Curve, I built and ran it and got the same error.

 ![image](https://us1.discourse-cdn.com/niantic/original/2X/7/7aaf64c480fde6ebd9c8a56a32f0fe22126198a9.png)

I will share the log with you.

> **[2023-04-20-Scanning.log](https://drive.google.com/file/d/1R5S-81G_r7o0pnl65oEhvAnmIvx_qmWo/view?usp=sharing)**
>
> Google Drive file.

There is text in the log that says Tap Scan button. This is the text I typed in; after tapping the Scan button, the screen froze a short time later.

The following error occurred.

```auto
2023-04-20 14:31:38.247513+0900 ScanningFramework[22494:8409885] Execution of the command buffer was aborted due to an error during execution. Caused GPU Address Fault Error (0000000b:kIOGPUCommandBufferCallbackErrorPageFault)
2023-04-20 14:31:38.262506+0900 ScanningFramework[22494:8409886] Execution of the command buffer was aborted due to an error during execution. Ignored (for causing prior/excessive GPU errors) (00000004:kIOGPUCommandBufferCallbackErrorSubmissionsIgnored)

```

For your information, my development environment and smartphone are as follows.  
Unity Editor 2020.3.28f1  
XCode 14.2  
Lightship ARDK 2.5.1  
iPhone 12 Pro (iOS 16.3.1)

I have now created a Unity Package for the modified project and uploaded it below.  
The name is scanningframework\_20230420.unitypackage.  
[https://drive.google.com/drive/folders/1mhRERy6-cqdNqGf3RnRARDCL4wVKyXlZ?usp=sharing](https://drive.google.com/drive/folders/1mhRERy6-cqdNqGf3RnRARDCL4wVKyXlZ?usp=sharing)

Best regards.

---

<div class="post-metadata">

**Author:** ![Maverick\_Niantic](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@Maverick\_Niantic](https://community.nianticspatial.com/u/Maverick_Niantic)\
**Post date:** [April 24, 2023, 11:19pm UTC](https://community.nianticspatial.com/t/scanning-feature-stuck-at-step-4/3454/9 "2023-04-24T23:19:48Z")

</div>

I want to thank you for your patience! It looks like the issue coincidentally still has to do with the `PointCloudVisualizer`. It is at no fault of your own; however. To fix this, you need to open up `PointCloudVisualizer.cs` and modify the `IsComputeBufferSupported()` method on line 204 to always return false. Our development team is working on a fix for iOS devices but for now this is the fix you have to do to prevent that error from occurring.

Best,  
Maverick L.

---

<div class="post-metadata">

**Author:** ![Maverick\_Niantic](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@Maverick\_Niantic](https://community.nianticspatial.com/u/Maverick_Niantic)\
**Post date:** [March 5, 2026, 11:44pm UTC](https://community.nianticspatial.com/t/scanning-feature-stuck-at-step-4/3454/10 "2026-03-05T23:44:51Z")

</div>

Closed on March 5, 2026, 11:44pm UTC

Age
