- Home /
Turn on lights based on proximity to controller.
Hi Im new to Unity 5 and scripting in general. I have a scene with a whole lot of point lights. These point lights each have a script changing the intensity of the lights randomly (to create a flickering effect). All these lights running this script at the same time however makes the game really laggy. Is there a way for me to control what lights are on due to their proximity to the character controller. That way not all lights will have to run at the same time. Can any one help with this, or even have other suggestions that could work.
Answer by Acid_kenobi · Apr 29, 2016 at 12:35 PM
Hey, depends on the style of game. If it were say a top down shooter I would say just let occlusion culling do its work (pretty sure this effects point lights). If its first or third person perhaps a large collider with an OnTriggerEnter enabling and disabling on each point light? Or triggers when player enters a certain area?
Hope that points you in the right direction :) Good luck
Your answer
![](https://koobas.hobune.stream/wayback/20220612075838im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Lighting question - how to make it dark in the distance 0 Answers
Character lighting issues 0 Answers
Dynamic objects lighting and rendering (exterior scene) 3 Answers
odd lighting at UV seams 1 Answer
Character Realism 1 Answer