# normal

> The surface normal of the detected Collider2D.

## Definition

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

```csharp
public Vector2 normal { get; set; }
```

### Remarks

When the physics query detects an intersection of a [Collider2D](/engine/6000.0/script-reference/unityengine/collider2d.md) at a specific [RaycastHit2D.point](/engine/6000.0/script-reference/unityengine/raycasthit2d/point.md) the `normal` is the surface normal of the [Collider2D](/engine/6000.0/script-reference/unityengine/collider2d.md) at that position.  A surface normal is a vector perpendicular to the collider surface edge in a direction pointing away from the collider.

Additional Resources: [RaycastHit2D.point](/engine/6000.0/script-reference/unityengine/raycasthit2d/point.md).

```csharp
using UnityEngine;

public class ExampleClass : MonoBehaviour
{
    public Vector2 direction;

    void Update()
    {
        // Cast a ray in the direction specified in the inspector.
        RaycastHit2D hit = Physics2D.Raycast(transform.position, direction);

        // If something was hit, draw a line from the hit position in the direction of the surface normal.
        if (hit)
            Debug.DrawLine(hit.point, hit.point + hit.normal, Color.yellow);
    }
}
```

**Note:** If a hit starts occuring inside a collider, the collision normal is the opposite direction of the line/ray query.
