- Home /
spotAngle won't set Cookie Size on Directional Light?
Hi According to the scripting reference, using the spotAngle parameter should set the cookie size on directional lights, but it doesn't seem to work. Setting the spotAngle within a script has no effect on the light and in fact
print(dirLight.spotAngle);
always shows 1, even if the cookie size is set differently in the inspector.
Is there a workaround to set the cookie size programmatically?
Thanks
Answer by HolBol · Jan 15, 2011 at 11:49 AM
Directional lights don't use the spot angle parameter, that's only for spotlights. Use cookie size!
Thanks, but the manual states that you use the spotAngle to alter the cookie size of directional lights: "var spotAngle The light's spotlight angle in degrees Used primarily for Spot lights. Alters the light cookie size on Directional lights. No effect for Point light" there doesn't seem to be a cookie size variable.
Your answer
![](https://koobas.hobune.stream/wayback/20220613095551im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Can't retrieve the cookie size 3 Answers
Directional Light Shadows With Cookies 1 Answer
How do I create a moving cookie texture for a directional light? 2 Answers
Directional Light Shadows with Cookies 1 Answer
Shadow To Ignore Specific Objects? 1 Answer