Detailed Setup
Last updated
Last updated
1). When starting your new project you'll need to use a character controller you wish! Add an PlayerControllerParent to your scene (From the prefabs folder). (Unless youβre using the demo which will already have one added but the package will be required to be imported before use). As the system specifically requires 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
2). Add FlashlightController / AudioManager / InputManager & UIManager to your hierarchy or scene from the assets βPrefabsβ folder. Add this asset wherever you want in your scene. See the example below.
NOTE: Only drag the FLUIManager prefab into the hierarchy, not the scene
3). On the FLUIManager object make sure to attach all UI elements as per all the children underneath that asset, refer to the screenshot below:
4). 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
Toggleable Inventory
If this is true, you can press the inventory key to open the flashlight UI
Infinite Battery
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
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 Spot
Add Flashlight_Spot gameobject from the FlashlightSwing gameobject
FlashlightMovement
Add Flashlight_Spot to the slot
AudioClip ScriptableObjects
Add the ScriptableObjects from the SO folder to the appropriate slots
5). Place a Flashlight_Battery_1 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.
NOTE: You can duplicate these later if you need as many batteries as you require. Make sure the asset has a βBox Colliderβ component.
6). Add the Flashlight_DarkMetallic or Flashlight_LightMetallic to your scene and place it where you want.
Add the FlashlightItem script to it, if not already attached and select the type again from the dropdown box.