Shootable

The ShootableAction component is used to create weapons that uses ammo loaded in clip to fire projectiles. For example any type of gun can be made with the ShootableAction.

The module groups for the ShootableActions are

  1. Trigger [S]: For shootable items simple, repeat or burst are usually used.
  2. Usable [M]: Any module shared between an UsableItemAction.
  3. Shooter [S]: The main shootable module will control how the projectiles are fired.
  4. Ammo [S]: The ammo used, usually ItemDefinition or infinite.
  5. Clip [S]: The clip containing the ammo that will be fired.
  6. Projectile [S]: The projectile to fire.
  7. Fire Effects [M]: The effects to trigger when firing.
  8. Dry Fire Effects [M]: The effects to trigger when trying to fire without ammo.
  9. Impact [M]: Invoke function on impact using the ImpactData.
  10. Reloader[S]: Reload the ammo to the clip which is usually animated.
  11. Extra [M]: Any other modules that are specific to shootable but does not fit in any other group.
Groups noted as ‘[S]’ may only have a single module active at once. This usually will be the first enabled one in the list.
Groups noted as ‘[M]’ can have many modules active at once. Usually all the enabled modules are considered active.
The ShootableAction use and reload flow is as follows:

Shooter

The Shooter modules are used to fire the projectiles. The ShootableFireData contains the following properties

  • Fire Point: the point where the projectile will be fired.
  • Fire Direction: The direction in which the projectile will be fired.
  • Projectile Data: The ProjectileData (contains the AmmoData).
  • Tracer Transform: The location that the tracer should spawn.
  • Fire Transform: The location that the weapon should fire from.
  • Trajectory Offset: An offset to the trajectory or the projectile.
  • Impact Layers: The layers in which the projectile can impact.
  • Velocity: The projectile velocity once fired.
Hitscan Shooter

This module uses a raycast to detect the target to impact instead of spawning a projectile.

Projectile Shooter

Spawns a projectile GameObject and listens to the impact event.

Firing Troubleshooting

If you are unable to fire a new Shootable Action ensure you have checked the following:

  • The inventory has ammo. An easy way to ensure this is true is to add your Ammo Item Definition to the Default Loadout of the inventory.
  • The use event is being fired. The weapon won’t try to be fired until the used event is triggered and this can be specified with the Use Event Animation Event Trigger on the shootable action.
  • The weapon is facing in the fire direction. The weapon won’t fire until after it is facing in the direction that it should be fired. This sensitivity can be adjusted within the Look Sensitivity field of the Look Sensitivity module. If the sensitivity is set to -1 then the weapon will always fire no matter which direction
    the weapon is facing

Ammo

The ammo used is normally determined by the ItemDefinition or is infinite. The AmmoData added to the ShootableStreamData contains the following properties

  • Valid: True if the ammo is valid.
  • Ammo Module: The ammo module.
  • Item Definition: Optionally assigned and used to determine if the weapon still has ammo.
  • Index: The index of the ammo within the clip.
  • Value: A value associated to the ammo to differentiate it from other modules.
  • User Data: Allows for custom data to be sent to the module.
Item Ammo

Uses the ItemAmount within the Inventory as ammo. The ammo loaded in the clip is removed from the Inventory.

Infinite Ammo

Ammo that is never depleted.

Clip

The shootable clip module contains information about the clip containing ammo for the weapon

Simple Clip

A simple clip that can contain a fixed amount of ammo.

Projectile

This module defines what projectile object gets spawned and when. The ProjectileData contains the following properties

  • Projectile Module: The projectile module.
  • Shootable Ammo: The ShootableAmmoData
  • Spawned Projectile GO: The spawned projectile GameObject.
  • Was Prespawned Projectile: Was the projectile spawned before it is to be fired (for example the arrow for a bow).
Basic Projectile

This module defines what projectile object gets spawned and when.

Spawn Projectile

Spawn a projectile. The projectile can be spawned when fired but also during reload or when aiming.

The SpawnProjectile module is the module you would use for the bow to spawn the arrow projectile. The SpawnProjectile module should also be used to show the shells being reloaded such as the shotgun.

Fire Effects and Dry Fire Effects

FireEffects are effects that get triggered but do not return any values to the ShootableAction. They are usually used for polish.

Generic Item Effects

Invoke Generic Item Effects.

Muzzle Effect

Spawn a muzzle effect when the weapon fires.

Shell Effect

Spawns shells when fired.

Smoke Effect

An effect that spawns a puff of smoke.

Recoil Effect

A module that adds a recoil effect on each shot.

Crosshairs Spread

This module allows crosshair spread when firing with the shootable weapon.

Impact

Invoke functions when the projectile impacts a target.

Generic Shootable Impact Module

Invokes the Impact Action Group.

Reloader

The module in charge of reloading the item.

Generic Reloader

A module that uses animation events to flow through the reload. The module takes into account most needs for a reload module such as animating the clip being replaced.

Careful with the Reload Attach Detach Clip field. The Reloadable Clip Transform will be reparented to the Reloadable Clip Attachement. The ReloadableClop CANNOT be a SkinnedMeshRenderer or a bone in the weapon rig. It is recomened that the clip should be a simple MeshRenderer.

Extra

Extra modules that do not fit in any other group.

Scope

Used to enable a scope object on a weapon.

Dry Fire Substate

This module allows you to set the animation substate to animate the item when it is out of ammo.

Look Sensitivity

Adds a look sensitivity to the shootable weapon. This avoids the item from being used when it is not looking in the fire direction.

Slot Item Monitor Module

A module used to define what information to show in the Slot Item Monitor.

Prevent Dry Fire

This module will prevent the shootable action from dry firing by preventing start use if there is no ammo.