# AITrafficSpawnPoint

Located at: Assets\TurnTheGameOn\SimpleTrafficSystem\Resources\AITrafficSpawnPoint

Please note that the **Mesh Renderer** and **Box Collider** components attached to this prefab are required and used by the pooling system. This is an intentional design decision that was made in order to utilize the following built in Unity callbacks to check the bounds of a spawn point, and the visibility of the spawn point by the camera; if the collider bounds are empty and the mesh renderer is not visible by the camera, cars are allowed to spawn.

Links to builtin callbacks utilized by the AITrafficSpawnPoint component:

* [OnTriggerEnter](https://docs.unity3d.com/ScriptReference/Collider.OnTriggerEnter.html)
* [OnTriggerExit](https://docs.unity3d.com/ScriptReference/Collider.OnTriggerExit.html)
* [OnTriggerStay](https://docs.unity3d.com/ScriptReference/Collider.OnTriggerStay.html)
* [OnBecameVisible](https://docs.unity3d.com/ScriptReference/Renderer.OnBecameVisible.html)
* [OnBecameInvisible](https://docs.unity3d.com/ScriptReference/Renderer.OnBecameInvisible.html)


---

# 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://simpletrafficsystem.turnthegameon.com/documentation/prefabs/aitrafficspawnpoint.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.
