# Adding to the Game

To add opponents to your game, you first need to create an **AI zone**:

1. Put all environment objects in your scene into **one parent object**.
2. Mark walls, floor, and other necessary objects as **static objects**.
3. Add the **AI Area** component to the parent object
4. Set the baking parameters you need and **bake the area**.

* The **Baked Agent Type** indicates which AI types will be able to move around this arena.
* If you are using more than one area in your scene, set different **Area Types** for them. This will limit opponents within one zone.

{% hint style="info" %}
You can create more areas and agent types in the Navigation tab *<mark style="color:orange;">(Window -> AI -> Navigation)</mark>.*&#x20;
{% endhint %}

![](https://3854890582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lf4aWZpqUiSipiEh-D6%2Fuploads%2Fh9u8iN0amYgGOHNJWpqZ%2FBake%20Area.png?alt=media\&token=fd0d6a4d-6c8b-41da-9aa8-bc59478b56f0)

After the area is ready you can add enemies to the scene. This can be done in 2 ways:&#x20;

* If you need to spawn enemies on specific points, add them to the **AI Area** script.&#x20;

![](https://3854890582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lf4aWZpqUiSipiEh-D6%2Fuploads%2FkTNXF6APu1puPUaSDrKK%2FSpawn%20Enemies.png?alt=media\&token=bf22bc92-0b9e-48d6-9343-4eb14f8c4056)

| **Behavior**     | Enemies' movement behavior in the scene                                                                                                                                                                                                                                                                                                                    |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Spawn method** | <p><strong>Random:</strong> one random point from the <strong>Spawn Zones</strong> will be chosen.</p><p><img src="https://3854890582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lf4aWZpqUiSipiEh-D6%2Fuploads%2FcNLYdCbQlsdTjULWEz70%2FSpawn%20Zones.png?alt=media&#x26;token=2dfd3463-bee8-4d16-b368-3904fb9b9a6d" alt=""></p> |
|                  | **Specific point:** set a spawn zone for an enemy as you need.                                                                                                                                                                                                                                                                                             |
| **∞**            | Spawn enemies constantly.                                                                                                                                                                                                                                                                                                                                  |
| **Count**        | **If ∞ is not active**, this number means how many enemies will be spawned during the game.                                                                                                                                                                                                                                                                |
|                  | **If ∞ is active**, this number means a limit of enemies in a scene. (if a player kill 3 zombies, 3 more will appear in the game)                                                                                                                                                                                                                          |
| **Time**         | A break between the appearance of enemies (in seconds).                                                                                                                                                                                                                                                                                                    |

* The second way is to place enemies on the scene in the places you need.

![](https://3854890582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lf4aWZpqUiSipiEh-D6%2Fuploads%2FrZiNaSSWTgRamI4nxoiT%2FScreenshot%202021-12-12%20at%2001.58.39.png?alt=media\&token=0636c017-c5dc-407f-b726-95e2f57a9f38)

See the sections below to learn how to add **waypoints**, **covers**, and **grass**.

{% content-ref url="adding-to-the-game/waypoints" %}
[waypoints](https://docs.gercstudio.com/enemies/adding-to-the-game/waypoints)
{% endcontent-ref %}

{% content-ref url="adding-to-the-game/covers" %}
[covers](https://docs.gercstudio.com/enemies/adding-to-the-game/covers)
{% endcontent-ref %}

{% content-ref url="adding-to-the-game/stealth-grass" %}
[stealth-grass](https://docs.gercstudio.com/enemies/adding-to-the-game/stealth-grass)
{% endcontent-ref %}
