# GetObjectPath(Object)

> Get the path of a Unity Object. If it is a GameObject or a Component it is the. Else it is the asset name.

## Definition

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

```csharp
public static string GetObjectPath(Object obj)
```

### Parameters

**** (\[Object]\(/engine/6000.7/script-reference/unityengine/object)): Object to obtain a path from.

### Returns

| Type                                                           | Description                    |
| -------------------------------------------------------------- | ------------------------------ |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | Returns the path of an object. |
