What I want to do is know if player is in shadows because Im making a race for my game that player cant go outside a cave or something and if he go outside he will burn because of sun. And to he dont get burned he would need be in a shadow.
Example: A vampire thing.
The best bet is checking if the player is in between the sun and the player.
Read here for more info:
The main idea is that, as you could somewhat infer from the topic’s title, if a player makes contact with an area that is under direct contact with the sun’s light on, a script would run. E.g. if the player is in a building and leaves it, going out into an area where the sun would be able to “shine” on them, i.e. no shadows, then the appropriate script would run.
However, I can’t seem to think of a legitimate way to do this - I’ve thought of making it so there’s a model/folder that holds parts …
For your particular use case though, you could probably just make an invisible touch box where if they’re outside the cave they can be burnt. That’d be far simpler.
It works perfectly thanks for showing me this! Will help me too much.