- Home /
flickering light
I don't know what is wrong. Please help. Here is my code:
FlickeringLights.enabled = false;
Here is the error:
Unexpected symbol `=' in class, struct, or interface member declaration
Answer by SisterKy · Feb 05, 2012 at 07:42 PM
My guess: FlickeringLights is an array of Objects you got by FindObjectsWithTag. Now you WANT to set every object in the Array .enabled=false. What you actually do is set the Array itself .enabled = false. That's probably not allowed.
for ( var light in FlickeringLights) {light.enabled = false}
Next time, please explain better what you want to do.
Also, it's good practice to let variables start lower-case. If you start them upper-case, people will think they are functions or classes and get confused.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Renderer on object disabled after level reload 1 Answer
Unexpected symbol error 1 Answer
Unexpected Symbol 'public' 1 Answer