# Overview & Quickstart

[**Projectile Factory**](https://assetstore.unity.com/packages/slug/281692?aid=1100lxWw) solves two common problems Unity developers face when creating projectiles: **Creation** & **Runtime Use**.

{% content-ref url="/pages/lRZvX4gCroTiNoltwqZy" %}
[Quick Start Guide](/magic-pig-games/projectile-factory/overview-and-quickstart/quick-start-guide.md)
{% endcontent-ref %}

## Creation

Creating projectiles is simple at first, but often developers find that they want new projecitles that do things...differently from the others. Firing one bullet, simple enough. But what about a machine gun? Or a bullet with some built-in inaccuracy? Or an arrow? Or a bullet hell mothership with hundreds of projectiles in a pattern?

In **Projectile Power**, each **Projectile** is made up of ***Behaviors*** which determine how the projectile spawns, moves, collides, and more. In the exampels below, we get two Projectiles with slightly different [**Spawn Behavior**](/magic-pig-games/projectile-factory/projectile-factory-documentation/spawn-behavior.md).

<div><figure><img src="/files/3gyb3ETOifDtCLfgOA2M" alt=""><figcaption><p>6 shots with slight inaccuracy</p></figcaption></figure> <figure><img src="/files/83OhsZFDUj2XaUnR3MRd" alt=""><figcaption><p>Even shots back and forth</p></figcaption></figure></div>

{% content-ref url="/spaces/-MY3N\_li2jPq7az6mYfq/pages/oqGe6Rn5s7t0OHmm1f7q" %}
[Projectile](/magic-pig-games/projectile-factory/projectile-factory-documentation/projectile.md)
{% endcontent-ref %}

These behaviors can be mixed and matched, and each behavior is a Scriptable Object, so you can have any number with various options set how you'd like.

### Use of Asset Store Particles

And if you're like me, you have tons of killer particle packages from the Asset Store, and you want to use them in your project. Many find that each particle package can set up wildly different from the others. Sometimes they're set up in a way that requires a large amount of manual work to actually use them.

And even then, they all work slightly differently. With **Projectile Factory**, your projectiles become uniform, no matter what particle package you're using, so you can quickly mix and match in your game. We also include many [**3rd Party Particle Integrations**](/magic-pig-games/projectile-factory/3rd-party-particle-integrations-16.md) that have projectiles ready to go for instant use.

### Extensibility

**Projectile Power** comes with many [**Behaviors**](/magic-pig-games/projectile-factory/projectile-factory-documentation/behaviors.md) ready to go, and a demo scene showcasing very common projectiles found in many games. If you want something more custom, you can easily create it.

{% content-ref url="/spaces/-MY3N\_li2jPq7az6mYfq/pages/hkd03zUfDZIszcRt5eYe" %}
[Behaviors](/magic-pig-games/projectile-factory/projectile-factory-documentation/behaviors.md)
{% endcontent-ref %}

At the core, each behavior starts as a very simple script. You can create new classes which override key methods in order to create custom behaviors, or add additional functionality that better fits your project.

**You can even sell what you create on the Asset Store 🤑**

## Runtime Use

Objects that spawn projectiles are called... [**Projectile Spawners**](/magic-pig-games/projectile-factory/projectile-factory-documentation/projectile-spawner.md)**!** With a clean custom Inspector, it's easy to add Behaviors and make new Projectiles for your game.

{% content-ref url="/spaces/-MY3N\_li2jPq7az6mYfq/pages/QjrszjgnayCZgLCafWvs" %}
[Projectile Spawner](/magic-pig-games/projectile-factory/projectile-factory-documentation/projectile-spawner.md)
{% endcontent-ref %}

Simple methods like `SpawnProjectile()`, `NextProjectile()`, `StopProjectile()` make it simple to hook up your player and NPC controllers to **Projectile Power**.

Once launched projectiles each have a [**Projectile**](/magic-pig-games/projectile-factory/projectile-factory-documentation/projectile.md) class -- also extensible. Other scripts can subscribe to event based notifications such as `Launch()`, `OnCollisionEnter()`, `OnDisable()` and more. In fact, this is how the various behaviors on the projectile are notified of events, including `UnityEvents` in the Inspector.

### Observers

In addition to the behaviors, you can also create [**Projectile Observers**](/magic-pig-games/projectile-factory/projectile-factory-documentation/observers-global-observers-and-observer-objects.md), which are similar to **Behaviors**, but do only what you code them to do.

{% content-ref url="/spaces/-MY3N\_li2jPq7az6mYfq/pages/f0VPUt84jSVB2Be678dB" %}
[Broken mention](broken://spaces/-MY3N_li2jPq7az6mYfq/pages/f0VPUt84jSVB2Be678dB)
{% endcontent-ref %}

In the demo scene, we use an observer to cause damage to the target when a projectile successfully hits it. This is a super common use case, and allows you to easily connect your game logic with the **Projectile Power** projectiles.

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

{% hint style="success" %}
Dig into the demo scene and documentation, and if you have any questions, come ask on the [**Discord**](https://discord.com/invite/cmZY2tH)!
{% endhint %}


---

# 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/overview-and-quickstart.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.
