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

  1. Add an PlayerControllerParent to your scene (From the prefabs folder).

    1. (Unless you’re using the demo which will already have one added)

  2. Make sure the FlashlightSwing empty gameobject to be attached to a empty parent.

  1. 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)

  2. 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

  1. Add a FLUIManager object from the prefabs or add your own via the scripts folder

  2. 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

  1. Add an Audio Manager prefab or script to your scene from the prefabs or the scripts folder

  2. Refer to page below for more details on adding new audio clips

Adding Audio Clips

Step 4 - Flashlight Controller Setup

  1. Add a FlashlightController

  2. 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

  1. Place a Battery or Flashlight Object into your scene from the prefabs folder

    1. Add the FlashlightItem script to it, if not already attached and select the object type.

    2. Add the number of batteries you will gain from picking up this object.

    3. 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

Was this helpful?