Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
3.02k stars 1.12k forks source link

Access to the mesh generated from NormalMeshes #980

Closed MarcoLavoro closed 2 years ago

MarcoLavoro commented 2 years ago

How do I access to the mesh generated inside the scene NormalMeshes to save it?

andyb-unity commented 2 years ago

You can subscribe to the ARMeshManager's meshesChanged event: https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@5.0/api/UnityEngine.XR.ARFoundation.ARMeshManager.html#UnityEngine_XR_ARFoundation_ARMeshManager_meshesChanged.

When you see that a MeshFilter has been added, you can access its mesh via the Mesh property: https://docs.unity3d.com/ScriptReference/MeshFilter-mesh.html