How to check if an object is in the light or not.?

Hi everyone, I need help, in the attached link you can see that, in the link the player if seen changes color based on whether he is seen by the light or is inside the shadow, how could I advance?
https://forum.gdevelop.io/uploads/default/original/3X/9/c/9cb8384445f585c6565acb721d11a54c6442a2a7.gif

Wait. So what is the question? It looks like it works perfectly fine.

sorry if i wasn’t clear, i want to do exactly what you see in the video, but i don’t know where to start

hmmmm… you could send a raycast from the light to the player’s position, and if anything blocks it, it’s in a shadow.
If you don’t know what a raycast is, here’s google’s answer:

" A raycast is conceptually like a laser beam that is fired from a point in space along a particular direction . Any object making contact with the beam can be detected and reported. This function returns the number of contacts found and places those contacts in the results array."

ok now i will do some tests yes in the past i used raycast on Unreal Engine 4, i didn’t think it could be used on Gdevelop xD. thanks for the help and much appreciated ^ ^