3 Step Setup:
Add Master Component to your AI Controller.
Add Slave Component to your Player Controller.
Go to Settings->Collision and add a Trace Channel:
Name: SightPerp
Default Collision: ignore
Once you've added your master component to the AI Controller. You can use the events and functions from within your AI Controller.
Component Settings:
Sight Distance (cm) - How far the AI can see. You do not need to set this low for dark environments, the Blueprint will handle it. --DEFAULT IS 50m--
Remember that distance effects the detection amount.
eg, Set to 5000 (50m) - So at 50m the detection amount will be 0%.
Peripheral vision Angle - AI's Peripheral vision Angle
Time To Forget (seconds) - How long before the AI forgets about the player. An example would be when the AI is searching for the player. --DEFAULT IS 0-- Note: 0 turns off the Forget feature.
Use Light Test - Will do light tests for Shadows, Darkness and our Light Blueprint --DEFAULT IS TRUE--
Minimum Detection Percentage (2-99) - The AI will never detect a Player under this percentage. --DEFAULT IS 45--
The On perception Updated Event will give the AI Controller an array of structures with the currently perceived actors, their detection percentage and their Last known Position.
The On Forgotten Actor Event will trigger every time the AI forgets an Actor based on the time in the 'Time to forget' setting.
Get Currently Perceived Actors is a function version of the On Perception Updated Event.
Get All Perceived Actor gets All Perceived actors even if they have been forgotten.
Get Known actors gets all Actors that have not been forgotten.
Component Settings:
Player Detection Multiplier - Use this to raise or lower detection eg, camouflage, Harder enemies, Harder levels etc. This is a Global Modifier.
SunLight Detection Multiplier - Raise or Lower Detection while in the sun.
Shadows Detection Multiplier - Raise or lower detection while in the shadows.
Light Detection Multiplier - Raise Or Lower Detection while standing near a light source.
We Added The Basic Light Component Settings to the 'Cillo Light' Blueprint, if you need more just click the component in the details panel.
Blueprint Settings:
Intensity - Sets the Light Intensity of the light.
Light Color - Color Of The Light
Attenuation Radius - Sets the Attenuation Radius of the light.
Use Temperature - To Use A Set Temperature
Temperature - Temperature
Component Settings:
NOTE: When adding this component it is important to call the Update collisions functions inside of the construction script of your blueprint.
Toggle Light Function - Turns Light On And Off
Update Collisions Function - Updates the lights collision after adjusting the light (This is also an editor function)
Player Detection Multiplier - Raises the detection level while player is under this light. eg, 0 would stop detection while player is in this light.
Editor Function :
Convert All Lights - Will Convert any light whom are not part of a blueprint into the 'Cillo Light' Blueprint.
Update All Collisions - Update All Light Component Collisions (If you adjust your lights just click this after to update them)