# PingObject

> Ping an object in the Scene like clicking it in an inspector.

## Definition

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

## PingObject(Object)

Ping an object in the Scene like clicking it in an inspector.

```csharp
public static void PingObject(Object obj)
```

### Parameters

**** (\[Object]\(/engine/6000.0/script-reference/unityengine/object)): The object to be pinged.

### Remarks

[EditorGUIUtility.PingObject](/engine/6000.0/script-reference/unityeditor/editorguiutility/pingobject.md) will cause the Hierarchy to highlight the pinged object. The pinged object does not have to be selected.  For example [GameObject.Find](/engine/6000.0/script-reference/unityengine/gameobject/find.md) can be used to locate an object to ping.

### Examples

```csharp
// Pings the currently selected Object
using UnityEditor;
using UnityEngine;

public class PingObjectExample
{
    [MenuItem("Examples/Ping Selected")]
    static void Ping()
    {
        if (!Selection.activeObject)
        {
            Debug.Log("Select an object to ping");
            return;
        }

        EditorGUIUtility.PingObject(Selection.activeObject);
    }
}
```

## PingObject(int)

Ping an object in the Scene like clicking it in an inspector.

```csharp
public static void PingObject(int targetInstanceID)
```

### Parameters

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

### Remarks

[EditorGUIUtility.PingObject](/engine/6000.0/script-reference/unityeditor/editorguiutility/pingobject.md) will cause the Hierarchy to highlight the pinged object. The pinged object does not have to be selected.  For example [GameObject.Find](/engine/6000.0/script-reference/unityengine/gameobject/find.md) can be used to locate an object to ping.

### Examples

```csharp
// Pings the currently selected Object
using UnityEditor;
using UnityEngine;

public class PingObjectExample
{
    [MenuItem("Examples/Ping Selected")]
    static void Ping()
    {
        if (!Selection.activeObject)
        {
            Debug.Log("Select an object to ping");
            return;
        }

        EditorGUIUtility.PingObject(Selection.activeObject);
    }
}
```
