# Unity Area Light

Our Area Light can be used at runtime as well as in editor.

There are two ways you can create Area Light.

1. **Manually adding in editor**

* Create an empty **Game Object**

<figure><img src="https://github.com/Realistic3D/RealAPI/blob/main/docs/readme/.gitbook/assets/1.jpg" alt=""><figcaption><p>Empty game object</p></figcaption></figure>

* Add new component "**Real Light**"
* That's it. Now you can perform transform operations such as "Position, Rotation, Scale" and area light operations such as intensity, color etc.

<figure><img src="https://github.com/Realistic3D/RealAPI/blob/main/docs/readme/.gitbook/assets/2.jpg" alt=""><figcaption><p>Real Light</p></figcaption></figure>

2. **By using C#**

```csharp
private void AddAreaLight()
{
    const float width = 1f;
    const float height = 2f;
    const float intensity = 20f;
    var color = Color.yellow;
    
    var areaLight = RealMesh.AreaLight(width, height, intensity, color);

    areaLight.transform.position = new Vector3(1, 2, 1);
}
```

<figure><img src="https://github.com/Realistic3D/RealAPI/blob/main/docs/readme/.gitbook/assets/4.jpg" alt=""><figcaption><p>Simple example of creating area light</p></figcaption></figure>

<figure><img src="https://github.com/Realistic3D/RealAPI/blob/main/docs/readme/.gitbook/assets/3.jpg" alt=""><figcaption><p>Real API area light</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://usmanheart.gitbook.io/realapi-1/area-light/unity-area-light.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
