Skip to content

Usage

The Shooter module has been designed so it's very easy to set up and incrementally add more complex features as your game requires.

Check the demos

It is highly recommended that you check the demo examples. This section assumes you have read the rest of the documentation and you're familiar with the concepts of Weapon, Sight, Reload and Ammo assets.

Equipping

Before doing any shooting, a character must first equip a Weapon asset and identify the prop that will be used as that weapon.

The Equip Weapon and the Unequip Weapon instructions serve this purpose.

Equip Weapon instruction

Common use-case

The most common way to equip a weapon is to attach a prop using the Attach Prop instruction and right after that use the Equip Weapon referencing the last prop equipped.

This workflow works also when using other modules, such as the Inventory 2.

Shooting

To make a character shoot with their weapon(s) use the Pull Trigger and Release Trigger instructions. Depending on the type of weapon that listens to these commands, the weapon wil behave one way or another.

Pull Trigger and Release Trigger instructions

By default these instructions affect the primary weapon equipped by the character. However if the character has more than one weapon equipped, you can specify which weapon the trigger pull and release affects.

Common use-case

The most common way of instructing the player to shoot is by creating two Trigger components: * On Button Press: This trigger uses the Pull Trigger instruction on the player. * On Button Release: This trigger uses the Release Trigger instruction on the player.

For NPCs and enemies you can add a Wait for Seconds instruction between the pulling and releasing of the weapon's trigger when aiming at their target(s).

Reloading

To make a character reload their weapon(s) use the Reload Weapon instruction.

Reload instructions

By default it reloads the primary weapon, but you can specify a particular one if your character has multiple weapons equipped.

Try Quick Reload instructions

During the reloading phase, a character might attempt to perform a Quick-Reload action using the Try Quick-Reload instruction. If the weapon being reloaded admits this feature, it will attempt it and shorten the reloading duration if successful.

When to use Reload

By default all Reload entries automatically attempt to reload when the character shoots with an empty weapon. The Reload instruction is meant to be used either by more advanced enemy AI that decides the best time to reload or the player.

You can create a Trigger that attempts to reload the player's weapon at any time when pressing the right button. If the weapon cannot be reload, the command will simply be ignored.

Jamming

If the Weapon's Jam section has a at least a chance to jam the weapon, it will eventually be jammed during gameplay. A jammed weapon cannot be reloaded nor shot with unless the jam is fixed.

Fix Jam instructions

To do so use the Fix Jam instruction, which initiates an animation and fixes the jamming issue.

Leaning

Characters can lean to the left or the right in order to shoot from corners. These leaning values are configured in the Biomechanics section of the Sight assets.

To lean to one side use the Character Lean instruction, which will roll the character's spine towards one side (or the other, if the angle is negative).

Character Lean instructions

To restore the value use the Character Lean instruction with a value of 0 degrees.

Leaning with Cameras

If the leaning is applied to the player and it is using an First Person camera shot, the camera will follow the leaning along with its rotation.