- Home /
What's best (performant) way to animate light bulbs?
I want to create a certain effect with animating lights, but I'm not quite sure on how to approach it the most optimized way. I've allready considered a couple of techniques, but I really need to have full control over every light, so I can make custom animations. Spritesheets are really not an option, because that's very limited.
Here's an example of what I'm trying to achieve:
(lights around the text 'casino')
It's really important to know that I want to have full control over every light, but I'm not sure how to do this. I will probably need a plane for every light seperately, but maybe there's another way...
Thoughts and tips are greatly appreciated.
Thanks
Answer by Loius · Oct 26, 2012 at 03:04 PM
The easiest way would be to have a single "lights" spritesheet, and each light be a plane with its uvs set to the right spot in the sheet (animating UV values is quite doable). i.e. On, Off, White, Yellow, Blue, etc.
If you have to control each one individually, there's no way to do it other than make them all separate. :)
You could use actual Light objects but I'd recommend against that for performance / visual reasons.
Yeah, I've come to realize that there's no other way than to have a plane for each light seperately. Using actual lights is absolutely no option, because it has to run on mobile devices. I'm still searching for an 'optimized' way to use as many 'lights' as possible with good performance, but it's really hard to find the best way. Thanks for your answer ;)
$$anonymous$$y two cents, it'd be best to have a single object with a script on it which controls all the lights (as an array), setting their uvs and such.
Welcome. :)
Your answer
Follow this Question
Related Questions
Adding animation clips via script 2 Answers
Is it reasonable to use OnBecameVisible for controlling animations, lights and particle systems? 1 Answer
Is 2d animation better for performance over particle system? 1 Answer
Find GameObject Position(x,z) and rotation(y) 1 Answer
Can an empty state in Animator cause performance issues? 1 Answer