n00b having scripti woes with Light.intensity (solved)

Hi all, I am still headbashing my way through scripting. The following script is tied to a point light, but when I try and run it, unity gives me an error, “An instance of type ‘UnityEngine.Light’ is required to access non static member ‘intensity’”.

function Update () {
var jetflux = (landerCore.landerEnginePower/100);

Light.intensity = jetflux;

}

all I want my point light to do is to glow by a factor of the jetflux variable.

I know this must be basic scripting but I am a bit lost…

I’m away from my machine to check anything, but (just a stab in the dark)…

try light.intensity = jetflux; (small ‘l’ in light)… if that fails try gameObject.light.intensity

I think you’re trying to access the ‘Light’ class and not the ‘light’ object.

Hope this helps (and works LOL),
Matt.

LOL i just returned to say I had fixed it with light.intensity instead of Light.intensity…

thanks though…

I knew it would be something daft.

No Probs, glad you got it going!

Matt.