> For the complete documentation index, see [llms.txt](https://heroicsolo.gitbook.io/heroic-engine/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://heroicsolo.gitbook.io/heroic-engine/basics/useful-components/projectile.md).

# Projectile

This component represents automatically moving projectile. This object inflicts damage to `Hittable` objects of all opposite teams in certain radius after entering into target collider or after certain amount of time.

Projectile can be auto guided to the target and it can chase it. Projectile class is inherited from IPoolableObject, so it can be got from PoolSystem and it automatically returns to pool after explosion.

### Parameters in inspector

<figure><img src="https://1131436974-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9rEHd0nHFvWCSkMEfAjl%2Fuploads%2FGA4EcGapVx5s9m1vHqWB%2Fimage.png?alt=media&amp;token=bc8a0d0f-f42b-4c2f-a80d-cfa989a799ec" alt=""><figcaption><p>Parameters in inspector</p></figcaption></figure>

**Velocity** – velocity of projectile movement (units per second). 10 by default.

**Guiding** – is this projectile guided to the target?

**Guiding Force** – how strong it is guided to the target? 0 = isn't guided, 1 = maximum guidance

**Guiding Angle** – width of guidance cone, if target is out of this cone, guiding will be stopped

**Guiding Max Dist** – max distance to target when guiding works

**Lifetime** – how much time projectile flies before automatical explosion

**Damage Min** – min damage to hittables

**Damage Max** – max damage to hittables

**Explosion Radius** – radius of explosion (1 unit by default)

**Explosion Effect** – poolable explosion particle effect.

**Launch Sound** - sound effect which will be played during projectile launch.

**Hit Sound** - sound effect which will be played during collisions.

***

### Available methods

```csharp
public void Launch(Transform target, Hittable owner = null)
```

*This method launches projectile from certain **owner** to the certain **target**. If owner is not set, this projectile will be neutral (TeamType.None) and will be able to inflict damage both to player team and enemies team.*

*Example:*

<pre class="language-csharp"><code class="lang-csharp">public class Player : MonoBehaviour, Hittable
{
    [SerializeField] private Transform muzzle;
    [SerializeField] private Projectile missilePrefab;

    public void Shoot(Hittable targetEnemy)
<strong>    {
</strong>        Projectile missile = PoolSystem.GetInstanceAtPosition(
            missilePrefab, 
            missilePrefab.GetName(), 
            muzzle.position, 
            muzzle.rotation);
    
        missile.Launch(targetEnemy.transform, this);
    }
}
</code></pre>

***

```csharp
public void Launch(Vector3 direction, Hittable owner = null)
```

*This method launches projectile from certain **owner** to the certain **direction**. If owner is not set, this projectile will be neutral (TeamType.None) and will be able to inflict damage both to player team and enemies team.*
