# PropertyIDToName(int)

> Returns the name of the shader property from its ID, or null string if the ID is invalid.

## Definition

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

```csharp
public static string PropertyIDToName(int id)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)):&#x20;

### Returns

| Type                                                           | Description                                                                             |
| -------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | The property name corresponding to the given ID, or a null string if the ID is invalid. |

### Remarks

This method allows you to get the original property name using the ID of a shader property. Use the name only for debugging and introspection, because passing strings is slower than passing property IDs.

Property IDs that were not created with [Shader.PropertyToID](/engine/6000.6/script-reference/unityengine/shader/propertytoid.md) are considered invalid.

Compared to [Shader.TryConvertPropertyIDToName](/engine/6000.6/script-reference/unityengine/shader/tryconvertpropertyidtoname.md), this method returns a null string in the situation where the property ID is invalid.

Check for null or an empty string to determine whether the ID was valid.

Additional Resources: [Shader.TryConvertPropertyIDToName](/engine/6000.6/script-reference/unityengine/shader/tryconvertpropertyidtoname.md), [Shader.PropertyToID](/engine/6000.6/script-reference/unityengine/shader/propertytoid.md).

### Examples

```csharp
using UnityEngine;

public class PropertyIDToNameExample : MonoBehaviour
{
    private void Start()
    {
        int propertyID = Shader.PropertyToID("_MainTex");
        Debug.Log(Shader.PropertyIDToName(propertyID)); // prints "_MainTex"

        int invalidId = 999999;
        Debug.Log(Shader.PropertyIDToName(invalidId)); // prints "null";
    }
}
```
