Detailed Setup
Quick Tips & Troubleshooting
You can add the Flashlight - Demo Scene Prefab to your project and it will have everything setup for you to get going straight away
FPS Controller usage
When starting your new project you'll need to use a character controller you wish - I have included my STFPSController for ease of use
System Setup
Step 1 - Player Setup
Add an PlayerControllerParent to your scene (From the prefabs folder).
(Unless youβre using the demo which will already have one added)
Make sure the FlashlightSwing empty gameobject to be attached to a empty parent.
Make sure the FlashlightSwing is parented to the PlayerControllerParent and NOT the FPSController
On the FPSController - Make sure you have the layer of Ignore Raycast (If you have troubles with the raycast not registering when you look towards the ground)
Make sure there is a FlashlightInteractor script on the Main Camera (This script could go on any object you wish
Step 2 - Flashlight UI Manager Setup
Add a FLUIManager object from the prefabs or add your own via the scripts folder
On the FLUIManager object make sure to attach all UI elements as per all the children underneath that object, refer to the screenshot below
NOTE: Only drag the FLUIManager prefab into the hierarchy, not the scene
Step 3 - Audio Manager Setup
Add an Audio Manager prefab or script to your scene from the prefabs or the scripts folder
Refer to page below for more details on adding new audio clips
Step 4 - Flashlight Controller Setup
Add a FlashlightController
Look at the FlashlightController object and look at the script and set references accordingly, and use values for your game.
Variable Name
Description
hasFlashlight
You can choose whether you have a flashlight at the beginning at start or not
Show Flashlight Inventory
If this is true, you can press the inventory key to open the flashlight UI
Infinite Flashlight
Tick this if you don't want to pickup batteries
Battery Drain Amount
Set to 0.01 for slow rate, higher values for faster burn rate
Battery Count
How many batteries you have at the start
Drain Battery Without Dimming
This means your battery level will decrease but the intensity of the flashlight will never change
Replace Battery Timer
The time it takes to hold a key to replace your current battery
MaxFlashlightIntensity
The maximum Intensity of the light source
FlashlightRotationSpeed
The speed the flashlight will follow the camera
Flashlight Inputs
The generic inptus for the system
Flashlight Spot
Add FlashlightSpotlight gameobject from the FlashlightSwing gameobject
FlashlightMovement
Add FlashlightSpotlight to the slot
AudioClip ScriptableObjects
Add the ScriptableObjects from the SO folder to the appropriate slots
Step 5 - Interactables & Pickups Setup
Place a Battery or Flashlight Object into your scene from the prefabs folder
Add the FlashlightItem script to it, if not already attached and select the object type.
Add the number of batteries you will gain from picking up this object.
Make sure this object has a box collider
NOTE: You can duplicate these later if you need as many batteries as you require
Last updated