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
- Trigger [S]: For shootable items simple, repeat or burst are usually used.
- Usable [M]: Any module shared between an UsableItemAction.
- Shooter [S]: The main shootable module will control how the projectiles are fired.
- Ammo [S]: The ammo used, usually ItemDefinition or infinite.
- Clip [S]: The clip containing the ammo that will be fired.
- Projectile [S]: The projectile to fire.
- Fire Effects [M]: The effects to trigger when firing.
- Dry Fire Effects [M]: The effects to trigger when trying to fire without ammo.
- Impact [M]: Invoke function on impact using the ImpactData.
- Reloader[S]: Reload the ammo to the clip which is usually animated.
- Extra [M]: Any other modules that are specific to shootable but does not fit in any other group.
Groups noted as ‘[M]’ can have many modules active at once. Usually all the enabled modules are considered active.
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.
This module uses a raycast to detect the target to impact instead of spawning a projectile.
Spawns a projectile GameObject and listens to the impact event.
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
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.
Uses the ItemAmount within the Inventory as ammo. The ammo loaded in the clip is removed from the Inventory.
Ammo that is never depleted.
The shootable clip module contains information about the clip containing ammo for the weapon
A simple clip that can contain a fixed amount of ammo.
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).
This module defines what projectile object gets spawned and when.
Spawn a projectile. The projectile can be spawned when fired but also during reload or when aiming.
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.
Spawn a muzzle effect when the weapon fires.
Spawns shells when fired.
An effect that spawns a puff of smoke.
A module that adds a recoil effect on each shot.
This module allows crosshair spread when firing with the shootable weapon.
Invoke functions when the projectile impacts a target.
Generic Shootable Impact Module
Invokes the Impact Action Group.
The module in charge of reloading the item.
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.
Extra modules that do not fit in any other group.
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.
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.