# surfaceAnchor

> The direction and distance to use when detecting if a surface is nearby during a slide iteration.

## Definition

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

```csharp
public Vector2 surfaceAnchor { readonly get; set; }
```

### Remarks

During a Slide this vector is used to detect if a surface is nearby and will cause the slide to be anchored in that direction to the surface.

The default is [Vector2.down](/engine/6000.5/script-reference/unityengine/vector2/down.md) which is a typical direction and distance used in platformers however this can be reduced in distance so that the surface anchoring is more subtle. If the surface anchor is [Vector2.zero](/engine/6000.5/script-reference/unityengine/vector2/zero.md) then surface anchoring will be disabled.

Additional Resources: [Rigidbody2D.Slide](/engine/6000.5/script-reference/unityengine/rigidbody2d/slide.md) and [Rigidbody2D.SlideResults](/engine/6000.5/script-reference/unityengine/rigidbody2d/slideresults.md).
