> For the complete documentation index, see [llms.txt](https://cowsinss-organization.gitbook.io/fps-engine-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cowsinss-organization.gitbook.io/fps-engine-documentation/content/03.-content/03.8-extra/destructible.md).

# Destructible

Implements from [IDamageable](/fps-engine-documentation/content/03.-content/03.6-enemies/idamageable.md), so it can be damaged and destroyed.

{% hint style="info" %}
This component must be added to ANY destructible object in your environment. However, you might want to check other examples such as [`Crate.cs`](/fps-engine-documentation/content/03.-content/03.8-extra/crate.md) or [`ExplosiveBarrel.cs`](/fps-engine-documentation/content/03.-content/03.8-extra/explosivebarrel.md). Although they are different objects with different functionalities, both are destructible and can be destroyed. How does this work? Their custom scripts inherit from `Destructible.cs`, which in turn inherits from `MonoBehaviour` and implements [`IDamageable`](/fps-engine-documentation/content/03.-content/03.6-enemies/idamageable.md). So, even though they perform different actions, they are fundamentally the same type of object. Since `Die()` is a virtual void method, you can override it in your custom script that inherits from this one.
{% endhint %}

* <mark style="color:purple;">maxHealth</mark>: Initial health of the destructible"
* <mark style="color:purple;">lootInside</mark>: Instantiate something cool when the object is destroyed, such as coins, a weapon, or any kind of loot, whatever you want! If this is empty, no reward will be instantiated
* <mark style="color:purple;">destroyedSFX</mark>: AudioClip to play on destruction.

### Functions & Accesors | Destructible.cs

> <mark style="color:green;">Damage ( float damage, bool isHeadsho</mark>t <mark style="color:green;">)</mark>
>
> Damages the IDamageable
>
> * **damage**: Damage to apply on the IDamageable
> * **isHeadshot**: Generally false for Destructibles.

> <mark style="color:green;">Die(</mark> <mark style="color:green;"></mark><mark style="color:green;">)</mark>
>
> Destroys the Destructible
