---
title: "Distance 2D"
url: "https://help.maxon.net/ag/en-us/Content/html/Generator_distance_2D.html"
section_path: "Generators > Numeric > Distance 2D"
description: "This generator returns the distance between 2 points, based on the transformations that affect each layer. This is useful to drive other parameters based …"
---

# Distance 2D

## Brief Description

This generator returns the distance between 2 points, based on the transformations that affect each layer. This is useful to drive other parameters based on the distance. For example the Scale of a Layer could be set to the distance between this Layer and another Layer, making it appear smaller when layers are closer and bigger when they are apart.

## Controls

| Parameter / Script Name | Type | Default | Function |
| --- | --- | --- | --- |
| `Enabled / enabled` | Boolean | On |  |
| `Source A Mode / mode0` | Choice | This Transform's Position | - *This Transform's Position*<br>- *Linked Layer/Path/Transform*<br>- *Custom Point* |
| `Layer/Path/Transform A / link0` | Link | - | This parameter allows to link either to a 2D Transform, 2D Layer, 2D Path |
| `Point A / customPos0` | Float 2D | 0, 0 |  |
| `Source B Mode / mode1` | Choice | Custom Point | - *This Transform's Position*<br>- *Linked Layer/Path/Transform*<br>- *Custom Point* |
| `Layer/Path/Transform B / link1` | Link | - | This parameter allows to link either to a 2D Transform, 2D Layer, 2D Path |
| `Point B / customPos1` | Float 2D | 0, 0 |  |
| `Multiplier / multiplier` | Float | 1 |  |
