# root

> Returns the topmost transform in the hierarchy.

## Definition

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

```csharp
public Transform root { get; }
```

### Remarks

(This never returns null, if this Transform doesn't have a parent it returns itself.)

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    // Is a collision between two objects with different roots?
    void OnCollisionEnter(Collision collision)
    {
        if (collision.transform.root != transform.root)
        {
            print("The colliding objects are not in the same hierarchy");
        }
    }
}
```
