# GUIDToAssetPath

> Gets the corresponding asset path for the supplied GUID, or an empty string if the GUID can't be found.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

## GUIDToAssetPath(string)

Gets the corresponding asset path for the supplied GUID, or an empty string if the GUID can't be found.

```csharp
public static string GUIDToAssetPath(string guid)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The GUID of an asset.

### Returns

| Type                                                           | Description                                       |
| -------------------------------------------------------------- | ------------------------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | Path of the asset relative to the project folder. |

### Remarks

Returned paths are relative to the project folder, for example: "Assets/MyTextures/hello.png".

```csharp
using UnityEditor;
using UnityEngine;

public class GUIDToAssetPathExample : MonoBehaviour
{
    [MenuItem("APIExamples/GUIDToAssetPath")]
    static void MaterialPathsInProject()
    {
        var allMaterials = AssetDatabase.FindAssets("t: Material");

        foreach (var guid in allMaterials)
        {
            var path = AssetDatabase.GUIDToAssetPath(guid);
            Debug.Log(path);
        }
    }
}
```

See [AssetDatabase.AssetPathToGUID](/engine/6000.7/script-reference/unityeditor/assetdatabase/assetpathtoguid.md) for a version that returns a string instead of a GUID.

## GUIDToAssetPath(GUID)

Gets the corresponding asset path for the supplied GUID, or an empty string if the GUID can't be found.

```csharp
public static string GUIDToAssetPath(GUID guid)
```

### Parameters

**** (GUID): The GUID of an asset.

### Returns

| Type                                                           | Description                                       |
| -------------------------------------------------------------- | ------------------------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | Path of the asset relative to the project folder. |

### Remarks

Returned paths are relative to the project folder, for example: "Assets/MyTextures/hello.png".

```csharp
using UnityEditor;
using UnityEngine;

public class GUIDToAssetPathExample : MonoBehaviour
{
    [MenuItem("APIExamples/GUIDToAssetPath")]
    static void MaterialPathsInProject()
    {
        var allMaterials = AssetDatabase.FindAssets("t: Material");

        foreach (var guid in allMaterials)
        {
            var path = AssetDatabase.GUIDToAssetPath(guid);
            Debug.Log(path);
        }
    }
}
```

See [AssetDatabase.AssetPathToGUID](/engine/6000.7/script-reference/unityeditor/assetdatabase/assetpathtoguid.md) for a version that returns a string instead of a GUID.
