# operator !=(Object, Object)

> Compares if two objects refer to a different object.

## Definition

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

```csharp
public static bool operator !=(Object x, Object y)
```

### Parameters

**** (\[Object]\(/engine/6000.3/script-reference/unityengine/object)): The first object to compare.**** (\[Object]\(/engine/6000.3/script-reference/unityengine/object)): The object to compare the first object to.

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) |             |

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    Transform target;
    void Update()
    {
        // the target object does not refer to the same object as our transform
        if (target != transform)
        {
            print("Another object");
        }
    }
}
```
