- Home /
Detect light or shadow falling on player
Hello guys. I have a question about light. I have a idea as temperature. it means that if player is detecting by light, or if player isn't in shadow for 10/15 minutes, the player temperature increases hmm e.g. 0.5 degree C. Can I detect a light(sun light) falling on player in real time? Maybe You have a other ideas about this? Thanks for help. (sorry for my bad english, i'm a Polish) :>
Answer by GiyomuGames · Jul 02, 2015 at 05:07 AM
You can send Raycasts between your player and the lights which are close enough to potentially lit the player. If your Raycasts are set to hit only your platforms (or any element blocking lights) then for each raycast if the result is null you will know that the player is currently being lit by the light.
Your answer
Follow this Question
Related Questions
Lightmapping Shadows Jagged 1 Answer
More detailed terrain shadow 0 Answers
Blob Shadows - Reversing Shadow Effect? 2 Answers
Dynamic objects lighting and rendering (exterior scene) 3 Answers
bake error 1 Answer