I am trying to make a vampire-esque enemy, when light is shone on the enemy it disappears, when there is no light it appears.
However, I’m not sure if there is any way to do this without premade regions where every light is.
I’ve created bricks that are under lamps that the NPC can detect and change transparency, however this doesn’t really work as it’s too sudden. I suppose I could loop it but I’d rather see if there is a built in function first.
@Maximum_ADHD made an open source test around 4 years ago that allows you to determine when a certain position is “illuminated” by a SpotLight.
Obviously it isn’t the most updated method given it was made 4 years ago and there could be better ways of doing so, but it’s the best I remember on a system like this being done. I haven’t seen any recent methods of doing this nor do I know how to do it myself.
@FragmentFour I would recommend that you do a “OnTouched” function for a part above the light its a much simpler solve and you can use it to change the transparency or brightness of a light. Hope this helped.
You can use a combination of tags, via the collection service using the tag editor plugin, and magnitude. First you can tags all the parts that have a light with a special “Light” tag and then use the collection service to get all the parts with the “Light” tag and then check the magnitude in respect to the vampire’s root part position. This will only work as expected if the direction in which the light is pointing does not matter.