> For the complete documentation index, see [llms.txt](https://heroicsolo.gitbook.io/heroic-engine/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://heroicsolo.gitbook.io/heroic-engine/basics/engine-utilities/transformutils.md).

# TransformUtils

This class provides additional functionality for working with Transform.

### Available Methods

***

```csharp
public static float Distance(this Transform from, Transform to)
```

*This method returns distance between two transforms.*

***

```csharp
public static float DistanceXZ(this Transform from, Transform to)
```

*This method returns 2D distance between two given 3D transforms (in XZ plane, ignoring Y).*

{% hint style="info" %}
This method could be useful for getting distance between characters in top-down or strategy games, ignoring height of that characters.
{% endhint %}

***

```csharp
public static void MoveTowards(this Transform t, Transform target, float speed)
```

*This method moves transform towards certain transform with given speed.*

***

```csharp
public static void ResetTransform(this Transform t)
```

*This method resets position, rotation and scale of given transform.*

***

```csharp
public static void LookAtIgnoreY(this Transform t, Transform target)
```

*This method faces transform to the given transform, ignoring Y axis. It could be useful for top-down games.*

*Example:*

```csharp
turretTransform.LookAtIgnoreY(enemyTransform);
```

***

```csharp
public static Transform FindDeepChild(this Transform parent, string name)
```

*This method searches a child Transform by its name even if this child is deeply nested.*

*Example:*

```csharp
var chairTransform = houseTransform.FindDeepChild("Chair");
```

***

```csharp
public static void SetUniformScale(this Transform t, float scale)
```

*This method sets the same scale for all axes.*

*Example:*

```csharp
transform.SetUniformScale(2f);
```

***

```csharp
public static bool IsVisibleFrom(this Transform t, Camera camera)
```

*This method checks if given transform visible for certain camera.*

*Example:*

```csharp
if (transform.IsVisibleFrom(Camera.main))
{
    //Do some logics if this transform is visible from main camera...
}
```

***

```csharp
public static void DestroyAllChildren(this Transform t)
```

*This method destroys all nested children of given transform.*

*Example:*

```csharp
rewardsTransform.DestroyAllChildren(); //Clear rewards UI slots
```
