# GetVertexAttributeDimension(VertexAttribute)

> Get dimension of a specific vertex data attribute on this Mesh.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public int GetVertexAttributeDimension(VertexAttribute attr)
```

### Parameters

**** (\[VertexAttribute]\(/engine/6000.0/script-reference/unityengine/rendering/vertexattribute)): Vertex data attribute to check for.

### Returns

| Type                                                       | Description                                                         |
| ---------------------------------------------------------- | ------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Dimensionality of the data attribute, or zero if it is not present. |

### Remarks

Meshes usually use a known format for data layout, for example, a position is always a 3-component Vector, and a tangent is always a 4-component Vector. But, in some cases (usually regarding texture coordinates), the data layout can be of different dimensionality. For example, [Mesh.SetUVs](/engine/6000.0/script-reference/unityengine/mesh/setuvs.md) accepts either a 2D, 3D or 4D texture coordinates. You can use this function to query this layout.

Additional Resources: [VertexAttribute](/engine/6000.0/script-reference/unityengine/rendering/vertexattribute.md), [Mesh.HasVertexAttribute](/engine/6000.0/script-reference/unityengine/mesh/hasvertexattribute.md), [Mesh.GetVertexAttributeFormat](/engine/6000.0/script-reference/unityengine/mesh/getvertexattributeformat.md), [Mesh.GetVertexAttributes](/engine/6000.0/script-reference/unityengine/mesh/getvertexattributes.md).
