Flashlight Sys - Setup
Last updated
Last updated
Make sure to have a "Flashlight_Canvas" object in your scene which will have all the UI elements. This will be a child of the "AK_CanvasContainer" if you've already imported it from the initial setup
Make sure you have the Flashlight Canvas added
Make sure your FPSController is a child of a parent object, this parent object should also have a child of "FlashlightSwing" attached. See below.
Make sure the "FlashlightSwing" GameObject has a "Flashlight_Spot" as a child, including:
FlashlightMovement script
Spotlight component
Add a "Flashlight Controller" prefab or script to an empty GameObject
Make sure the "FlashlightController" script is UNTICKED by default or you will be able to interact as if you had a flashlight at the start
Add a PBR flashlight or Battery object to your scene and do have the following:
Set the tag to "InteractiveObjects"
Set the layer to "Interact"
Add a "Box Collider"
Add an "AKItemController" and set the value to "FlashlightSys"
Add the "FlashlightController" (Or Manager) depending on the naming conventions you use to the empty slot!
Add the "FlashlightItemController" script and set it to "Flashlight" or "Battery" depending on the item you wish to use.
Do the same for the battery object but change the settings accordingly.
See more details below:
This object should be an empty GameObject and it will control everything that goes on for your flashlight system!
Flashlight Object setup - You can add a PBR Flashlight Object to your scene
Make sure your flashlight object has a tag of "InteractiveObject" and a Layer of "Interact"
Add a "Box Collider" to your object
Add an "AKItemController" - Set the System Type to: "FlashlightSys"
Add a "FlashlightItemController" script to the object
Add the "FlashlightController" gameobject - Which will have the "FlashlightController"
Choose the object type: Flashlight
Battery Object setup - You can add a PBR Battery Object to your scene
Make sure your flashlight object has a tag of "InteractiveObject" and a Layer of "Interact"
Add a "Box Collider" to your object
Add an "AKItemController" - Set the system type to: "FlashlightSys"
Add a "FlashlightItemController" script to the object
Add the "FlashlightController" gameobject - Which will have the "FlashlightController"
Choose the object type: Battery
Left Click to interact with a pickup
Press “F” to turn the flashlight On / Off
Press “Q” to replace a battery
Press “TAB” to open the inventory
NOTE: The flashlight manager does have an option to include an "Infinite battery option, so the flashlight will never run out of power!
These can be edited in the "InputManager"
Infinite Flashlight
Tick this if you don’t want to pickup batteries
Battery Deg
Set to 0.01 for slow, rate. Higher for a faster burn rate
Battery Count
How many batteries you have at the start and currently
Max Flashlight Intensity
The maximum intensity of the flashlight
Flashlight Rotation Speed
The speed the flashlight will follow the camera
Battery Level
Add the “UI_BatterySlider” from the canvas
Battery Count UI
Add the “UI_BatteryCount” from the canvas
Flashlight On UI
Add “Flashlight_Indicator_On” from the canvas
Flashlight Off UI
Add “Flashlight_Indicator_Off” from the canvas
Main Flashlight UI
Add “MainFlashlightUI” from the canvas
Flashlight Spot
Add “Flashlight_Spot” gameobject from “FlashlightSwing”
Flashlight Movement
Add “Flashlight_Spot” to the “FlashlightMovement”