Need help disabling shadows after a certain time

I’m making a realistic game, and have added a day and night cycle. Using future technology in lighting, I came across an issue where the light, upon activating, casts a weird shadow from the lightpost on the ground. Disabling shadow fixed the issue, but I would like for the shadow to remain on during the day, for the realism.

So my question is, what script can I use to disable the shadow on an object after a certain in-game time, and then re-enable the shadow on the object after a certain ingame time, creating the perfect cycle using 12:00:00 format to fix my issue.



You would have to use a while wait loop and check if the time is > 7:00:00 and < 20:00:00 for example and then change castShadow to true else false

2 Likes