# TryGetSubmeshClassifications(MeshId, Allocator, out uint, out NativeArray<uint>, out NativeArray<uint>)

> Gets classification information for vertices or vertex sets for meshes obtained through XRMeshSubsystem.TryGetMeshInfos. This must be enabled through _submeshClassificationEnabled.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.XR](/engine/6000.5/script-reference/unityengine/xr.md)
* **Assembly:** UnityEngine.XRModule

## TryGetSubmeshClassifications(MeshId, Allocator, uint, NativeArray\<uint>, NativeArray\<uint>)

```csharp
public bool TryGetSubmeshClassifications(MeshId id, Allocator allocator, out uint elementsPerVector, out NativeArray<uint> vertexIndexVectors, out NativeArray<uint> classifications)
```

### Parameters

**** (\[MeshId]\(/engine/6000.5/script-reference/unityengine/xr/meshid)): A [MeshId](/engine/6000.5/script-reference/unityengine/xr/meshid.md) obtained earlier through TryGetMeshInfos for which to retrieve classification information**** (\[Allocator]\(/engine/6000.5/script-reference/unity/collections/allocator)): The [Allocator](/engine/6000.5/script-reference/unity/collections/allocator.md) type to use for the returned NativeArrays**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): The number of packed elements in vertexIndexVectors to treat as one classification unit. Platform-specific; for example, some platforms may use `1` for a single vertex per classification; others may use `3` to represent a triangle face per classification.**** (\[NativeArray\<uint>]\(/engine/6000.5/script-reference/unity/collections/nativearray1)): The indices referring to [Mesh](/engine/6000.5/script-reference/unityengine/mesh.md) vertices that the classifications apply to, coallated with classifications.**** (\[NativeArray\<uint>]\(/engine/6000.5/script-reference/unity/collections/nativearray1)): The opaque classification enumerations returned by the provider for the defined vertex components above.

### Returns

| Type                                                          | Description                                          |
| ------------------------------------------------------------- | ---------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the retrieval is successful, otherwise False |

### Remarks

Use this to retrieve semantic classifications for vertex or vertex group components of the meshes tracked by the subsystem.

This method always returns new NativeArrays, even when there are no results. The caller is responsible for disposing the returned NativeArray, though specifying the appropriate [Allocator](/engine/6000.5/script-reference/unity/collections/allocator.md) will manage this for you.

Additional Resources: [\_submeshClassificationEnabled](/engine/6000.5/script-reference/unityengine/xr/xrmeshsubsystem/submeshclassificationenabled.md), [XRMeshSubsystem.TryGetMeshInfos](/engine/6000.5/script-reference/unityengine/xr/xrmeshsubsystem/trygetmeshinfos.md)
