Way for light to detect if a part is lit up by it?

i don’t know how to really explain it, but what i want to achieve is that if a spot light and a part comes in contact with eachother, it starts a function (tool that haves a spotlight attached to it, and it would detect if an invisible part is near, where it would make the part visible.)

1 Like

Just cast a constant ray the direction the light is headig, then detect colissions

2 Likes

Your best bet would be to cast a ray like Sparsrsa suggested, since getting what objects are actually getting lit up by the light would be difficult because lights are usually done through shaders. So instead you could sort of imitate a light, and to do that you could use a cone shaped raycast to provide a better way of detecting what hit the light.