> For the complete documentation index, see [llms.txt](https://infinitypbr.gitbook.io/magic-pig-games/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://infinitypbr.gitbook.io/magic-pig-games/projectile-factory/projectile-factory-documentation/projectile/projectile-data.md).

# Projectile Data

Each [**Projectile**](/magic-pig-games/projectile-factory/projectile-factory-documentation/projectile.md) has a `ProjectileData` object attached to it. Many behaviors will make use of the *Speed* value on this object, to determine how fast the Projectile should move. The demo scene also utilizes the *Damage* value.

{% hint style="info" %}
If you create your own **Movement Behavior** (or other [**Behaviors**](/magic-pig-games/projectile-factory/projectile-factory-documentation/behaviors.md)), you do not have to make use of the data in **Projectile Data**. However, I would advise that you do utilize it, and also customize your own class which inherits from it, allowing more custom funcationality specific to your game.
{% endhint %}

Most likely you will want to create a new class which inherits from `ProjectileData`, and has additional data you need for your projectiles.

*Each game is unique.* **Projectile Factory** comes with the extensibility required to let you build **YOUR** game.

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

This is the "*Fast Projectile*" in the demo scene, and some projectiles use this to move faster than others. The **Damage** value is used when a projectile collides with the **Demo Target**. Check the console, and the script, to see how.

## Custom Class Example

The ProjectileDataDemoDamageOverTime inherits from ProjectileData, and is used for demo projectiles like lasers and flame throwers, which likely cause damage over time rather than per collision.

```csharp
namespace MagicPigGames.Projectiles
{
    [CreateAssetMenu(fileName = "New Damage over Time Projectile Data", menuName = "Projectile System/Projectile Data - Demo Damage Over Time")]
    [System.Serializable]
    public class ProjectileDataDemoDamageOverTime : ProjectileData
    {
        protected override float CalculateDamage() => damage * Time.deltaTime;
    }
}
```

Here we update the `CreateAssetMenu` options, so that you can create new `Scriptable Objects` of this type, and override the `CalculateDamage()` method, multiplying it b y `Time.deltaTime`.

Your custom classes can go deeper, if you'd like, connecting your projectiles to your game data and stats, and even adding additional `Properties` that work with your custom [**Behaviors**](/magic-pig-games/projectile-factory/projectile-factory-documentation/behaviors.md) specific to your game.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://infinitypbr.gitbook.io/magic-pig-games/projectile-factory/projectile-factory-documentation/projectile/projectile-data.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
