Hi, I am making an android game. I have stationary directional light in my scene. I have baked light maps for static object in my scene. How do I turn on/off shadows at runtime through widget. What are the ways I can achieve it. I hope asked my question correctly. Thanks.
You mean you want to disable dynamic shadows? I’m pretty sure you can’t “disable” the baked ones. You can already turn off dynamic shadows in the details panel of your directional light (and skylight too if you have that).
Though, I’m not sure if the dynamic shadow casting can be changed at runtime or not.
If that doesn’t work, you could always try the Execute Console Command node. Here is a list of console commands.
If you set shadows to 0, I believe that turns them off.
Hello detach 789, I have stationary directional light in my scene. In my widget blueprint I get reference to directional light and set cast shadows enabled or disabled. As it is stationary it can be changed at runtime. It works good on pc as expected it turns off/on shadows through widget. But it doesn’t work on mobile.