🔫MShooteable
1.4.5
Last updated
1.4.5
Last updated
This component allows firing projectiles from a weapon.
Here are the main steps you need to set up a Shooteable weapon properly:
The Weapon mode will be set by the Weapon ID
Every shootable weapon needs at least Aim, Reload, and Fire animations. Those need to be set on the Mode Abilities and the Animator Controller.
Fire Ability: 101
Aim Ability: 97
Reload Ability: 96
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.
All the Animations have a duplicated version just in case the weapon needs to be used on the opposite hand:
Fire and Reload animations are optional. they can be skipped if [Has Fire Anim] and [Has Reload Anim] are set to false.
The Shootable weapon needs a Projectile to release. You need to set a gameobject with the MProjectile component in the Projectile parameter
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
Continues to attack if the Main Input is still pressed down.
Weapons can be charged before releasing the attack. E.g. The bow can bend to fire the arrow.
Charge Mechanic is only activated if the Projectile is set to Release on Attack Released
Evaluate the Charge value in the Curve
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
Charge multiplier to Apply to the Character Charge Value (For the Animator Parameter)
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.
Sets the way the weapon will handle the Aiming mechanic
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.
This dictates the position the Aim Profile Camera is going to be placed, In the left or Right side of the shoulder.
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.
Adds an extra angle in the Up Direction to fire the projectile. It creates a parabole trajectory.
By Default if the weapon is aiming, it cannot be unequipped. Enable this parameter to interrupt the Aim and Unequip the weapon.
When is set to true, the Character will call the Fire Abilty (x101) on the mode.
Set when the projectile is going to be equipped.
You can set multiple options but the projectile will be equipped on the first action. All other actions will be ignored.
Sets when the projectile is going to be released.
Never: The projectile will be not released by me. (This is used when Invector weapons are the ones firing the projectiles)
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. ⭐This Option enables the Charge Weapon Mechanic
The projectile is released by an animation Message. You will need to add a Weapon Behavior Directly to the animation.
If Release by animation is disabled. The projectile release will be delayed by this value
Prefab of the actual projectile to shoot.
Transform that the projectile will be parented to.
Force to release the projectile. If the Charge mechanic is active the force will be influenced by the Charge normalized value.
Force type applied to the Projectile rigid body.
Gravity transferred to the projectile. Set it to Vector3.zero if you want the projectile to travel with no gravity influence.
Ignores completely the reload mechanic. The weapon will never run out of ammo
The Weapon uses a reload animation to complete the reload mechanic. The Character will call the Reload Abilty (x096) on the mode.
Time elapsed since the reload action and animation were called, and the actual Reload logic where the ammo is updated.
When true, the reload logic will be called when there's no ammo in the chamber
Weapon chamber capacity. E.g. a Pistol can shoot 8 bullets without having to reload. Riffle can shoot 30 bullets without having to reload.
Current projectiles in the chamber. When this value is set to zero, you cannot fire any projectiles until you reload again
The totalTotal amount of projectiles the weapon has available
General Parameters are shared between all Weapons. Check all parameters here.
Damage Parameters are shared between all Weapons. Check all parameters here.
IK Parameters are shared between all Weapons. Check all parameters here.