# Trajectory

Trajectories are generally visual indications of where an projectile may land. **Projectile Factory** supports both pre-launch trajectories, which allows the [**Projectile Spawner**](/magic-pig-games/projectile-factory/projectile-factory-documentation/projectile-spawner.md) to give the player valuable information before they shoot a projectile, and active trajectories, which allow [**Projectiles**](/magic-pig-games/projectile-factory/projectile-factory-documentation/projectile.md) to display their trajectory while in flight.

{% hint style="success" %}
**Projectile Factory** ships with a number of **Trajectory Behaviors** ready to use. Trajectories are a very important part of any game which makes use of them, as they provide an immense amount of data to the player.

Trajectories are often specifically designed for the game they are in.

You will likely wish to [create your own **Trajectory Behaviors**](/magic-pig-games/projectile-factory/projectile-factory-documentation/create-custom-behaviors.md) in order to provide your players the specific experience you're creating.
{% endhint %}

<div><figure><img src="/files/ZAcZMqV6p203HU2uIIm9" alt=""><figcaption><p>This projects a line 3m forward - great for lasers</p></figcaption></figure> <figure><img src="/files/uvSDf7SLOZW7MIeN05sQ" alt=""><figcaption><p>This shows a UI image where the Projectile is aimed</p></figcaption></figure></div>

## Assigning Pre-Launch Trajectories

The [**Projectile Spawner**](/magic-pig-games/projectile-factory/projectile-factory-documentation/projectile-spawner.md) accepts a default **Trajectory Behavior** which will be used whenever a [**Projectile**](/magic-pig-games/projectile-factory/projectile-factory-documentation/projectile.md) does not have one of its own.

<figure><img src="/files/QWYmi4E7id1pyEs1lm9R" alt=""><figcaption></figcaption></figure>

Each **Projectile** also has an option. If populated, the **Spawner** will use the projectiles **Trajectory Behavior** instead. One **Trajectory Behavior** may not work well for another **Projectile**, so it's important to choose the right **Trajectory** for each **Projectile**.

<figure><img src="/files/XfE5lYc9J1bjNQyH4dW7" alt=""><figcaption></figcaption></figure>

## Active Trajectories (Post-Launch)

Trajectories assigned to a **Projectile** can optionally be active post-launch by including them in the [**Behaviors**](/magic-pig-games/projectile-factory/projectile-factory-documentation/behaviors.md) list on the **Projectile**.


---

# 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://infinitypbr.gitbook.io/magic-pig-games/projectile-factory/projectile-factory-documentation/trajectory.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.
