- Home /
This question was
closed Aug 16, 2014 at 06:29 PM by
meat5000 for the following reason:
The question is answered, right answer was accepted
Question by
Ssiroo · Aug 16, 2014 at 06:18 PM ·
javascripterrorlightshadows
BCE0053: Property 'UnityEngine.Component.light' is read only.
Hello, I'll make it short. Why am I getting this error :
BCE0053: Property 'UnityEngine.Component.light' is read only.
This is my code :
var sun : Light;
var enableShadows : boolean = true;
function Start()
{
enableShadows = true;
if(enableShadows == true)
{
sun.light = LightShadows.Hard;
}
}
This is just a small part of my code, but the other part doesn't have anything to do with this one.
Thank you.
Comment
Best Answer
Answer by JustFun · Aug 16, 2014 at 06:26 PM
Correct this:
sun.light = LightShadows.Hard;
to this:
sun.light.shadows = LightShadows.Hard;