# Infinity

> A representation of positive infinity (Read Only).

## Definition

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

```csharp
public const float Infinity = Infinity
```

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    // Casts a ray from (0,0,0) towards (0,0,1) to the infinity and prints a message
    // if any object has touched the ray.
    // To test it, just place any object and intersect it with the white drawn line

    void Update()
    {
        // shows the line that follows the ray.
        Debug.DrawLine(Vector3.zero, Vector3.forward * 100);
        if (Physics.Raycast(Vector3.zero, Vector3.forward, Mathf.Infinity))
        {
            print("There is something in front of the object!");
        }
    }
}
```
