# implicit operator bool(Object)

> Determines whether the object exists.

## Definition

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

## implicit operator bool(Boolea)

```csharp
public static implicit operator bool(Object exists)
```

### Parameters

**** (\[Object]\(/engine/6000.0/script-reference/unityengine/object)):&#x20;

### Returns

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

### Remarks

The three examples below give the same result.

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    // check if there is a rigidbody attached to this transform
    void Start()
    {
        if (GetComponent<Rigidbody>() == true)
        {
            Debug.Log("Rigidbody attached to this transform");
        }
    }
}
```

...is the same as this...

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    // check if there is a rigidbody attached to this transform
    void Start()
    {
        if (GetComponent<Rigidbody>())
        {
            Debug.Log("Rigidbody attached to this transform");
        }
    }
}
```

...which is also the same as this...

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    // check if there is a rigidbody attached to this transform
    void Start()
    {
        if (GetComponent<Rigidbody>() != null)
        {
            Debug.Log("Rigidbody attached to this transform");
        }
    }
}
```
