# GetVertexAttributeDimension(VertexAttribute)

> Gets the dimension of a given vertex attribute in the MeshData.

## Definition

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

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

### Parameters

**** (\[VertexAttribute]\(/engine/6000.3/script-reference/unityengine/rendering/vertexattribute)): The vertex attribute to get the dimension of.

### Returns

| Type                                                       | Description                                                                                      |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Returns the dimension of the vertex attribute. Returns 0 if the vertex attribute is not present. |

### Remarks

Most vertex attributes have a standard data layout. For example, a normal is a 3-component vector. Some vertex attributes (usually texture coordinates) have more than one possible data layout. For example, [SetUVs](/engine/6000.3/script-reference/unityengine/mesh/setuvs.md) accepts either 2 dimensional, 3 dimensional or 4 dimensional texture coordinates. You can use this function to query the layout of a given vertex attribute. Additional Resources: [HasVertexAttribute](/engine/6000.3/script-reference/unityengine/mesh/meshdata/hasvertexattribute.md), [GetVertexAttributeFormat](/engine/6000.3/script-reference/unityengine/mesh/meshdata/getvertexattributeformat.md).
