Have a look at the following situation:
The pill-shaped object on the right is the character controlled by the player. The cone/cylinder object on the left uses a spotlight to create the green light ring. The yellow debug line is being casted from the spotlight source to the middle of the character mesh and is obstructed by the wall in the middle.
As in this approach, I’m checking if the player character collides with the cone of the spotlight first. If this condition is met, I’m casting a ray from the spotlight source to the middle of the player character.
As you can see in the image above, the problem with this is that I can’t detect a character that is only partially (without its middle point) visible, and I haven’t found a good solution to this yet. The only idea that came to my mind was to just do multiple raycasts, but I doubt that’s a good solution as it’s still very inaccurate. What techniques could I use to check if the character is being directly lit by the light source? I’m using the UE4.12, in case there have been some new related features I didn’t notice.