# GUIDToAssetPath

> Gets the path of the asset with a GUID in string form, relative to the project folder.

## Definition

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

## GUIDToAssetPath(string)

Gets the path of the asset with a GUID in string form, relative to the project folder.

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

### Parameters

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

### Returns

| Type                                                           | Description                                                                          |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | The project-relative path of the asset, or an empty string if no asset has the GUID. |

### Remarks

Use this method to find where an asset is stored when you have its GUID. Paths are relative to the project folder, for example `Assets/MyTextures/hello.png`. To get the GUID of an asset as a string, use [AssetDatabase.AssetPathToGUID](/engine/7000.0/script-reference/unityeditor/assetdatabase/assetpathtoguid.md).

### Examples

```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);
        }
    }
}
```

## GUIDToAssetPath(GUID)

Gets the path of the asset with the specified GUID, relative to the project folder.

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

### Parameters

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

### Returns

| Type                                                           | Description                                                                          |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | The project-relative path of the asset, or an empty string if no asset has the GUID. |

### Remarks

Use this method to find where an asset is stored when you have its GUID. Paths are relative to the project folder, for example `Assets/MyTextures/hello.png`. To get the GUID of an asset, use [AssetDatabase.GUIDFromAssetPath](/engine/7000.0/script-reference/unityeditor/assetdatabase/guidfromassetpath.md).
