---
description: 1.4.5
---

# MShooteable

## Overview

This component allows firing projectiles from a weapon.

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FrMiNL2TgTOSDtDygvbVc%2Fimage.png?alt=media&#x26;token=e4f8a30c-1613-4725-8a15-ccf374ba39d9" alt="" width="536"><figcaption></figcaption></figure>

## Requirements

Here are the main steps you need to set up a Shooteable weapon properly

..........(Incomplete)

### Mode and Abilities

The Weapon mode will be set by the [**Weapon ID**](https://malbersanimations.gitbook.io/animal-controller/main-components/weapon-manager/mweapon-general-properties#weapon-data)

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FWVHUSSonyFqNVZTI0k9a%2Fimage.png?alt=media&#x26;token=fb818f44-806e-4be2-b61a-9bc63f101873" alt="" width="375"><figcaption></figcaption></figure>

Every shootable weapon needs at least  Aim, Reload, and Fire animations. Those need to be set on the Mode Abilities and the Animator Controller.

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FOBKGXMZpgXW3uhrfh50r%2Fimage.png?alt=media&#x26;token=e9af403c-4e4a-4281-80e9-440e009fbce4" alt="" width="375"><figcaption></figcaption></figure>

* **Fire Ability: 101**
* **Aim Ability: 97**
* **Reload Ability: 96** &#x20;

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2Fq6bIIEXWZ1zGf1Uiimvo%2Fimage.png?alt=media&#x26;token=db4348ee-4327-402e-8085-258003b78883" alt="" width="493"><figcaption><p>Rifle Mode (ID: 301) and it 3 Abilities</p></figcaption></figure>

### Animations and Animator

The Animations for the Weapons are set on the Layer Upper Body. This allows them to move around, walk, run, crouch, jump, etc, and use the shootable weapon only on the upper body.

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FAHnHWNdCtHsybBUvAbnD%2Fimage.png?alt=media&#x26;token=3e001a63-d86d-47f5-9227-f365391c859c" alt=""><figcaption></figcaption></figure>

All the Animations have a duplicated version just in case the weapon needs to be used on the opposite hand:

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FAishrLygO4FczZtoruRS%2FUnity_1Eiv7ZHKZ8.gif?alt=media&#x26;token=d43ccda8-3382-4190-ab37-7c9ba937015c" alt=""><figcaption><p>Rifle Aim Right Hand and Rifle Aim Left Hand use the same condition transitions, but the Parameter Left Hand is different. (True or False)</p></figcaption></figure>

{% hint style="info" %}
Fire and Reload animations are optional. they can be skipped if **\[Has Fire Anim]** and \[**Has Reload Anim]** are set to false.
{% endhint %}

### Animation Curves

All the animations involved with aiming must have the IKAim Curve.  This will allow to activate the IK aiming system for the weapons

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FrG03EMWDBSFdoarpZx1M%2Fimage.png?alt=media&#x26;token=05498f1d-fa27-44c1-a103-8acc68cbf424" alt=""><figcaption></figcaption></figure>

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FZa4531I9evtMKMYKoD4X%2Fimage.png?alt=media&#x26;token=4f079581-34f9-4b5f-8b8e-d02c8c367ede" alt=""><figcaption><p>The animation will set the Aim IK Weight to this value (1) while that animation is playing</p></figcaption></figure>

### Projectile

The Shootable weapon needs a Projectile to release. You need to set a gameobject with the MProjectile component in the Projectile parameter

***

## Shootable Parameters

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FdAtY4qONIcwRF3NZ5xKj%2Fimage.png?alt=media&#x26;token=f240eb50-5dab-4dff-a9d0-4a20f259cc1e" alt="" width="500"><figcaption></figcaption></figure>

### Rate

The time delay between attacks. Once a weapon has attacked or released a projectile. it will wait until this time to release the next attack

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FtkovEZ81SKRFBjjQwXfs%2FUnity_GZUVl9myj4.gif?alt=media&#x26;token=70b8950e-42c8-43ae-b146-a5f8e156bcb3" alt="" width="563"><figcaption></figcaption></figure>

### Automatic

Continues to attack if the Main Input is still pressed down.

### Charge time

Weapons can be charged before releasing the attack. E.g. The bow can bend to fire the arrow.

{% hint style="warning" %}
Charge Mechanic is only activated if the Projectile is set to Release on **Attack Released**
{% endhint %}

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FOAOlKxTItnQCQs6bbdOA%2Fimage.png?alt=media&#x26;token=a805f687-33a5-45aa-9022-d0db8d859782" alt="" width="509"><figcaption></figcaption></figure>

### Charge time Curve

Evaluate the Charge value in the Curve

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FnvHt8bUJPSOYTxjtdSJ1%2FUnity_hVJXnm0XnZ.gif?alt=media&#x26;token=fa00747f-4018-43f8-9671-1a6e0cfccb3f" alt="" width="563"><figcaption></figcaption></figure>



### Max Charge

The max value of the charge that goes from 0 to this value. This value is sent to the Animator  for the BlendTree of Charge animations

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2F0j3QJ6IsLf03Vi8kIheD%2FUnity_3x6wZaRbow.gif?alt=media&#x26;token=c2af2836-8086-4d48-8d0b-03003ad726a3" alt=""><figcaption></figcaption></figure>

### Charge Character Multiplier (CM)

Charge multiplier to Apply to the Character Charge Value (For the Animator Parameter)

***

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FMsGRrx9gwMxm5goSdvyd%2Fimage.png?alt=media&#x26;token=a6bfba1a-aa65-49cd-8494-c71ba85f9fac" alt="" width="492"><figcaption></figcaption></figure>

### Aim Origin

If the projectile is equipped before the attack is released. it will be parented to this Transform. E.g. The arrow is parented to the string before it is released.

### Aim Action

Sets the way the weapon will handle the Aiming mechanic

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FlZFL4CDe2DuW5NvNvxiO%2Fimage.png?alt=media&#x26;token=c9867eec-7f0d-42a8-858e-c8f6c0795bc2" alt="" width="341"><figcaption></figcaption></figure>

* **Manual**: The Weapon after is equipped it need to enable the Aiming State via Input
* **Automatic**: As soon as the Weapon is equipped  it will enter the Aiming State. Firing a projectile will also activate the aiming state
* **Ignore**:  Firing projectiles does not require aiming.

{% embed url="https://streamable.com/pcerin" %}

### Aim Side

This dictates the position the Aim Profile Camera is going to be placed, In the left or Right side of the shoulder.

### Aim Limit

The weapon will limit firing a projectile if the Angle formed between the Fire Direction and the Forward Direction of the Character. Usually, this is only applied when the character is not strafing or when is mounting the horse. E.g. The Bow cannot shoot arrows in a certain angle due to the harsh position .

The angle is dictated by the Aim Component Aim Horizontal parameter.

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2Fce9RO1udqjajtKMxdLpx%2FUnity_WNYXg1LoYc.gif?alt=media&#x26;token=866a2745-f564-478b-a613-63b26236d20b" alt="" width="563"><figcaption><p>From 90 to 180 the aim is disabled</p></figcaption></figure>

### Use Aim Angle

Adds an extra angle in the Up Direction to fire the projectile.  It creates a parabole trajectory.

### Unequip On Aim

By Default if the weapon is aiming, it cannot be unequipped. Enable this parameter to interrupt the Aim and Unequip the weapon.

***

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FNq1ibnT4lxWhCAEptC3t%2Fimage.png?alt=media&#x26;token=9e5a123d-d47f-4c53-bb16-4b29da1478ab" alt="" width="498"><figcaption></figcaption></figure>

### Has Fire Anim

When is set to true, the Character will call the Fire Abilty (x**101**) on the mode.&#x20;

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FowDpUdOpvrFSxzXcfOlc%2FUnity_cnHqo9U6jq.gif?alt=media&#x26;token=b810b677-11d8-41a2-b320-70a544e5aaad" alt=""><figcaption></figcaption></figure>

### Equip Projectile

Set when the projectile is going to be equipped.

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FKQl5l5HnJG2e85qQQ4i5%2Fimage.png?alt=media&#x26;token=bdb60918-654d-40a5-98a7-7476f5f071c5" alt=""><figcaption></figcaption></figure>

You can set multiple options but the projectile will be equipped on the first action. All other actions will be ignored.&#x20;

### Release Projectile

Sets when the projectile is going to be released.

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FlRwdxKe1T2q8SBhBjyiu%2Fimage.png?alt=media&#x26;token=ad46b1c0-eb4c-4798-a838-e9513c488e9d" alt=""><figcaption></figcaption></figure>

* **Never**: The projectile will be not released by me. (This is used when Invector weapons are the ones firing the projectiles)&#x20;
* **On Attack Start:** The projectile is released as soon as the Attack Input is pressed
* **On Attack Released:** The projectile is released after Attack Input is released. ⭐<mark style="color:green;">**This Option enables the Charge Weapon Mechanic**</mark>

### Release by Animation

The projectile is released by an animation Message. You will need to add a Weapon Behavior Directly to the animation.

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FcoO2QuyxoCmhjcmn1lek%2Fimage.png?alt=media&#x26;token=e26a1849-4254-423a-aefc-24ff01ff0160" alt="" width="563"><figcaption><p>Throwables have a Fire Projectile  Message attached to the animation itself</p></figcaption></figure>

### Release Delay

If Release by animation is disabled. The projectile release will be delayed by this value

### Projectile

Prefab of the actual projectile to shoot.

### Projectile Parent

&#x20;Transform that the projectile will be parented to.

***

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FnKl8CYu92IbPczyBuzvd%2Fimage.png?alt=media&#x26;token=4b8a6e5a-b619-4277-a045-414dd51588ed" alt="" width="492"><figcaption></figcaption></figure>

### Min and Max Force

Force to release the projectile. If the Charge mechanic is active the force will be influenced by the Charge normalized value.

### Force Mode

Force type applied to the Projectile rigid body.&#x20;

### Gravity

Gravity transferred to the projectile. Set it to Vector3.zero if you want the projectile to travel with no gravity influence.

***

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2F36Pw16KmkYtUHP07KyZL%2Fimage.png?alt=media&#x26;token=ca92c578-08e9-4697-a916-54e3fce33ea8" alt="" width="495"><figcaption></figcaption></figure>

### No Reload

Ignores completely the reload mechanic. The weapon will never run out of ammo

### Has Reload Anim

The Weapon uses a reload animation to complete the reload mechanic. The Character will call the Reload  Abilty (x**096**) on the mode.&#x20;

### Reload Time

Time elapsed since the reload action and animation were called, and the actual Reload logic where the ammo is updated.

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FOQLEB6yomKBkaVwZ4xEA%2FUnity_hap8mzM7Ff.gif?alt=media&#x26;token=2820c50a-6467-47af-8f98-214c05461bab" alt="" width="563"><figcaption><p>The ammo updates 2 seconds after the reload animation is playing</p></figcaption></figure>

### Auto Reload

When true, the reload logic will be called when there's no ammo in the chamber

### Chamber Size

Weapon chamber capacity. E.g. a Pistol can shoot 8 bullets without having to reload. Riffle can shoot 30 bullets without having to reload.&#x20;

### Ammo In Chamber

Current projectiles in the chamber. When this value is set to zero, you cannot fire any projectiles until you reload again

### **Total Ammo**

The totalTotal amount of projectiles the weapon has available

***

## General Parameters

General Parameters are shared between all  Weapons. Check all parameters [**here**](mweapon-general-properties)**.**

## Damage Parameters

Damage Parameters are shared between all  Weapons. Check all parameters [**here**](mweapon-damage-properties)**.**

## IK Parameters

IK Parameters are shared between all  Weapons. Check all parameters [**here**](mweapon-ik-properties)**.**

## Extra Parameters



***











