# GetLayerOrdinal(string)

> Get a layer ordinal (index) for the specified layer name. This is not a 32-bit mask but simply the layer ordinal (index) associated with the specified layer name.

## Definition

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

```csharp
public static int GetLayerOrdinal(string layerName)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The layer name (case sensitive) to find the layer ordinal for.

### Returns

| Type                                                       | Description                                                                                                                                                                                                                                                                                  |
| ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The layer ordinal associated with the specified layer name or, if not found, [PhysicsLayers.InvalidLayerOrdinal](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicslayers/invalidlayerordinal.md) will be returned in which case a console warning will also be produced. |
