> For the complete documentation index, see [llms.txt](https://malbersanimations.gitbook.io/animal-controller/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://malbersanimations.gitbook.io/animal-controller/secondary-components/mdamager/mprojectile.md).

# MProjectile

## Overview

`MProjectile` is the runtime component on a projectile prefab — an arrow, a bullet, a thrown axe, a rolling spike. It handles impact damage, pooling and life-time cleanup through the same [Damager](/animal-controller/secondary-components/mdamager.md#overview) system used by melee weapons.

It can be fired on its own with `Fire()`, or launched by a component that prepares it first — a [Projectile Thrower](/animal-controller/secondary-components/mdamager/projectile-thrower.md), a [Shootable weapon](/animal-controller/how-to-ac/create-a-shootable-weapon-from-scratch.md), or a Super Item's [Projectile - Fire](/animal-controller/super-item/super-item-system/item-processors/projectile-fire.md) processor. Whichever fires it calls `Prepare()` to hand over gravity, velocity, the hit layer and the object pool before calling `Fire()`.

{% hint style="info" %}
**How the projectile travels is now a separate, swappable object.** Earlier versions hard-coded a single ballistic trajectory directly on `MProjectile`, with Rotation Behavior and Gravity as its own fields. That logic now lives in a **Movement** — Flying, Rolling, or Homing — assigned in the **Physics** tab. Existing prefabs migrate automatically the first time they're opened in the editor, or in one pass via **Tools ▸ Malbers Animations ▸ Migrate Projectiles To Movements**. Nothing already authored on a saved prefab is lost.
{% endhint %}

\[Img: Inspector overview, four tabs visible]

## General

It uses the same properties as the [MDamager General Tab](/animal-controller/secondary-components/mdamager.md#general).

## Projectile Properties

### Life

Amount of seconds the projectile stays in the air. If it hasn't touched anything by the time this runs out, it's removed (destroyed or returned to its pool — see **Impact Behavior** below).

### Life Impact

Life of the projectile AFTER impact. If it isn't destroyed on impact, it waits this long before being removed. Set to 0 to ignore it.

### Radius

Radius used to Sphere Cast ahead of the projectile (Flying and Homing), so a fast-moving or small target isn't missed by a thin ray.

### Offsets

#### Position

Local position offset applied when the projectile is instantiated on the launcher — e.g. nudging the arrow into the bow's grip.

#### Rotation

Local rotation offset applied the same way.

### On Impact

#### Impact Behavior

| Option                  | Behavior                                                                                            |
| ----------------------- | --------------------------------------------------------------------------------------------------- |
| **None**                | Stops exactly where it hit.                                                                         |
| **Stick On Surface**    | Sticks to the contact point and parents itself to the surface. Use for arrows, spears, thrown axes. |
| **Destroy On Impact**   | Destroyed immediately — never returned to the pool.                                                 |
| **Activate Rigid Body** | Enables full physics on the Rigidbody so it can bounce, roll, or fall away naturally.               |
| **Disable On Impact**   | Deactivated and returned to the pool immediately.                                                   |

{% hint style="info" %}
**Projectiles stuck together auto-release.** If a Stick On Surface projectile embeds into ANOTHER projectile (e.g. a thrown axe lands on an already-stuck axe), the child is automatically unparented the moment the parent one is destroyed or returned to its pool — it isn't dragged along or recycled with it. Only the immediate child is released; if that child has something stuck to IT, that one stays attached.
{% endhint %}

#### Penetration

*(Stick On Surface only.)* How far the projectile is pushed into the surface, so it doesn't visually float above it.

#### Drag On Impact

*(Activate Rigid Body only.)* Linear drag applied to the Rigidbody once physics takes over.

### References

#### Rigid Body

Reference to the projectile's Rigidbody. A Movement drives it directly (kinematic `MovePosition` / `MoveRotation`) while the projectile travels — it is never launched with `AddForce`.

#### Collider

Reference to the projectile's main collider.

#### Trail

Optional Trail Renderer, cleared automatically whenever the projectile fires or returns to the pool.

## Damage

It uses the same properties as the [MDamager Damage Tab](/animal-controller/secondary-components/mdamager.md#damage).

### Keep Values

Disabled by default. A launcher that fires this projectile overrides its Stat Modifier, Hit Layer and Trigger Interaction — e.g. the arrow gets its damage from the bow, the bullet from the pistol. Enable it to always use the values authored on the projectile itself, regardless of what fires it.

## Physics

### Physics Force

#### Min Force / Max Force

Minimum and maximum force applied to a Rigidbody the projectile hits.

#### Force Mode

Standard Unity `ForceMode` used when applying that force.

### Push Multiplier

Multiplier applied on top of the force pushed into the Rigidbody the projectile hits.

### Movement

{% hint style="info" %}
This field is empty until a Movement is assigned — the projectile can't travel without one. A newly added `MProjectile` defaults to **Flying**.
{% endhint %}

The **Movement** is a swappable module that owns everything about how the projectile actually travels — its position, its rotation, and, for Rolling, its own hit detection. Three ship with the framework:

```
MProjectile
  └─ Movement
       ├─ Flying   – ballistic trajectory: arrows, bullets, thrown axes, fireballs
       ├─ Rolling  – kinematic ground sweep: rolling spikes, ground-hugging blades
       └─ Homing   – steers toward a target: seeking arrows, homing missiles
```

\[Img: Movement field, showing the Flying / Rolling / Homing type picker]

A launcher — Projectile Thrower, Shootable weapon, or the [Projectile - Fire](/animal-controller/super-item/super-item-system/item-processors/projectile-fire.md) item processor — can also carry its own **Movement Override**, which replaces the Movement of every projectile it fires without touching the projectile prefab itself. Leave a launcher's override empty to use whatever Movement the projectile already has.

#### Flying Movement

The ballistic trajectory. Gravity and Rotation are both owned here now — see the hint at the top of this page if you're coming from a version where they lived directly on `MProjectile`.

**Rotation**

| Option                | Behavior                                                    |
| --------------------- | ----------------------------------------------------------- |
| **None**              | Keeps the rotation it was fired with.                       |
| **Follow Trajectory** | Turns to face its direction of travel — arrows, spears.     |
| **Random**            | Spins continuously around one random axis picked at launch. |
| **Axis**              | Tumbles around a fixed local axis — a thrown axe.           |

\[Img: Rotation dropdown on Flying Movement, showing all four options]

**Torque**

*(Random and Axis only.)* Speed of the spin, in degrees per second.

**Torque Axis**

*(Axis only.)* Axis the projectile spins around, in its OWN local space. E.g. a thrown axe tumbling end over end spins around its local Right `(1, 0, 0)`.

**Axis Follow Trajectory**

*(Axis only.)* Enabled: the projectile faces its trajectory AND spins around Torque Axis on top of that — a thrown axe. Disabled: it keeps the rotation it was launched with and only spins in place — a shuriken.

**Trajectory Roll**

*(Follow Trajectory only.)* Roll around the flight axis, in degrees per second.

**Gravity**

Gravity applied while the projectile flies. Zero makes it travel in a straight line. A launcher reads this value to aim, so the predicted trajectory line always matches the real flight.

**After Distance**

Delays gravity until the projectile has travelled this many meters. Set to 0 to apply gravity from the moment it's fired.

\[Img: Gif of a projectile with After Distance = 5]

#### Rolling Movement

{% hint style="info" %}
Rolling is a kinematic ground sweep — it ignores gravity, mass and drag entirely. Layers in **Ground Mask** are what it walks on and is blocked by; they NEVER count as damage. Everything on the Hit Layer is damaged as the projectile sweeps through it.
{% endhint %}

\[Img: Gif of a spike rolling along uneven ground and stopping at a wall]

**Direction**

| Option                        | Source                                                                                                         |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------- |
| **Owner Forward** *(default)* | The direction the firing character is facing.                                                                  |
| **Launch Velocity**           | The spawn point's own forward — usually a hand bone, which can point wherever the rig's axis happens to point. |
| **Aim Direction**             | The Owner's Aim component direction, when it has one.                                                          |

**Speed**

Travel speed in meters per second. Set to 0 to use the launch Velocity's magnitude (the launcher's Power) instead.

**Ground Mask**

Layers the projectile treats as ground and as blocking obstacles.

**Deactivate**

| Option               | Behavior                                             |
| -------------------- | ---------------------------------------------------- |
| **Life** *(default)* | Removed once **Life** (seconds) elapses.             |
| **Max Distance**     | Removed once **Max Distance** (meters) is travelled. |

**Max Distance / Destroy On Max Distance**

*(Used when Deactivate is Max Distance.)* Max Distance is how far it can travel. Destroy On Max Distance removes it the instant that's reached; disabled, it stops in place and waits out **Life Impact** first.

**Destroy On Life**

*(Used when Deactivate is Life.)* Same choice, for the Life timer.

**Start Offset**

Distance in meters to push the spawn point forward — along the travel direction — before the projectile starts moving. Useful for clearing the caster's own collider.

**Height Offset**

Extra height above the ground surface, added on top of the collider's own automatically-measured clearance.

**Max Up Slope Angle / Max Down Slope Angle**

Steepest slope the projectile can climb or descend, in degrees. Anything steeper stops it — Up for a wall, Down for a ledge. Set either to 0 to ignore that limit entirely.

**Align To Ground**

Tilts the projectile to match the ground normal while it travels — the usual choice for a spike or blade hugging the terrain.

**Rotation / Torque / Torque Axis / Trajectory Roll**

Rolling's own copy of the Rotation Behaviour described under Flying Movement above (they're separate fields, not shared). Only used when **Align To Ground** is disabled.

**Pierce**

Enabled: damages every target it sweeps through and keeps travelling. Disabled: stops on the first target it damages.

**Rolling Events**

*(Shown only while Rolling Movement is selected.)*

**On Hit Tag** — invoked when the projectile's main collider hits a GameObject carrying one of its Tags.

**On Hit Position Without Impact / On Hit Transform Without Impact** — invoked when a Magic Particle (not the main collider) hits something, without stopping the projectile.

**On Reached Max Distance** — invoked when the sweep ends. `true` when it stopped because Max Distance was reached; `false` for every other reason (obstacle, slope, life, no ground under it).

#### Homing Movement

\[Img: Gif of a projectile curving toward a moving target]

**Target Source**

| Option                    | Behavior                                                                                                      |
| ------------------------- | ------------------------------------------------------------------------------------------------------------- |
| **Owner Aim** *(default)* | Chases the Owner's Aim component target, then its aim point.                                                  |
| **Nearest In Radius**     | Chases the nearest valid collider inside **Search Radius**, re-acquiring automatically if the target is lost. |

**Speed**

Travel speed in meters per second. Set to 0 to use the launch Velocity's magnitude.

**Turn Rate**

How fast the projectile can steer toward its target, in degrees per second.

**Homing Delay**

Seconds to fly straight before homing kicks in — lets the projectile clear the caster first.

**Search Radius**

*(Nearest In Radius only.)* Radius used to find, and to re-acquire, a target.

**Lose Target Angle**

Stops homing once the angle to the target exceeds this, in degrees — the projectile has overshot and flies straight from then on. Set to 0 to home forever.

**Face Direction**

Rotates the projectile to face its direction of travel.

### Interactions

#### Custom Reaction

Your own custom reaction, run in place of the Damage Receiver's default one.

#### Interact / Interactor ID

If the Damage Receiver has an [Interactable](/animal-controller/global-components/interactable.md) component, Interact triggers it, sending Interactor ID as the value.

### Effects

#### Audio Source

AudioSource used to play the surface hit sound. Added automatically if the projectile doesn't already have one.

#### Hit Effects

Surface Effects asset played on impact. Entry `[0]` is the default effect, used when the target has no Surface of its own.

#### Effect Duration

Time before the Hit Effect is returned to its pool. Set to 0 and the effect is never auto-released — it must disable itself.

### Stop Animator

#### Animator Stop Time

Time the Animator will be stopped. If it's zero, stopping the Animator is ignored.

#### Animator Speed

Value of the Animator's speed while it's stopped.

#### Animator

If there's an Animator Controller, it will be the one stopped.

## Events

### On Fire

Invoked when the projectile is fired.

### On Ray Cast Hit

Invoked when Flying or Homing's forward cast finds a hit, right before the impact is processed.

### On Hit

Invoked when the projectile hits a damager.

### On Hit Position

Invoked when the projectile hits a damager. Returns the hit point on the Damager Receiver.

### On Hit Interactable

Invoked when the Damager Receiver has an Interactable attached.

### On Profile Changed

Invoked when the damage profile changes.

### On Attack Missed

Invoked when the attack roll comes back a miss.

### On Critical

Invoked when the hit lands as a critical.

{% hint style="info" %}
Rolling Movement adds four more events — On Hit Tag, On Hit Position/Transform Without Impact, and On Reached Max Distance — documented under [Rolling Movement](#rolling-movement) above, since they only appear in the inspector while Rolling is selected.
{% endhint %}
