Skip to content

Flashlight


Overview

This is a guide on how to use the flashlight using the functionalities provided by the GunnerGirlComponent.
On the example GunnerGirl_Character blueprint, the default input is set to D-Pad Down or Q, which is used to toggle the flashlight on/off.

Flashlight

Properties

If you select the GunnerGirlComponent on your character, there will be 2 properties that can be modified from the Details panel.
This will affect the status of the flashlight at the beginning of the game.

  • IsFlashlightEquipped is used to tell the system whether the character starts off by carrying a flashlight item or not.
    The lights can only be turned on/off if the value of IsFlashlightEquipped is set to true.
  • IsFlashlightOn is used to tell the system whethern the lights should be on or off.
    This property will only have an effect if IsFlashlightEquipped have been set to true.

It is advised to only modify these properties to reflect the status of the character's flashlight at the beginning of the game.
For further usage of the flashlight during runtime, please use the functions listed in the Functions section below.

Flashlight3

Functions

There are 4 functions that can be used related to the flashlight.

Flashlight2

1. Equip Flashlight

Used to tell the system that the character is carrying a flashlight item.
A call to Toggle Flashlight or Activate Flashlight will only be processed after Equip Flashlight is called at least once.
The parameter IsFlashlightOn is used to indicate whether the flashlight should be in a lights ON or OFF status when first picked up.

2. Unequip Flashlight

Used to tell the system that the character is not carrying a flashlight item.
Any call to Toggle Flashlight or Activate Flashlight will be ignored once this function is called.

3. Activate Flashlight

Used to turn on/off the flashlight once equipped, depending on the value given for parameter IsFlashlightOn.

4. Toggle Flashlight

Toggle the flashlight.
Turn the lights on when its off, and off when it's on.


OnFlashlightUpdated Event

Whenever EquipFlashlight, UnequipFlashlight, ActivateFlashlight, or ToggleFlashlight is called, the event OnFlashlightUpdated will be activated.

UpdateFlashlightStatus

In the default setup, this event is used to sync the status of the flashlight on the GunnerGirl_Component with the ones available on the equipped guns.
The usage is not mandatory, as you can also control each of the flashlights manually if you want, as long as you have access to the required FlashlightComponent.

ActivateFlashlightComponent