Can you check if an entity is illuminated by lighting?
5 replies, posted
Title is self-explanatory; I was wondering if it was possible to check if an entity is illuminated by a light source
Don't believe so, Maybe a custom function where it checks for a gmod_light within a certain radius of the entity?
You can use render.ComputeLighting clientside, but there is no concept of lighting serverside.
Unfortunately it doesn't change with lights given by player flashlights which is exactly what I need from it. It does change with the sandbox light, however it doesn't change with the lamps (which use a projected texture dont they?)
Player/FlashlightIsOn
Player/GetFOV
Vector/Distance
you could put these together as a janky way of getting what you want. check the player's view frustum, whether the flashlight is on, and then do a simple quadratic equation to calculate light intensity at a given distance.
Sorry, you need to Log In to post a reply to this thread.