I participate in the Unity lightning contest, with the hope to win a Unity pro licence.
You can see all entries on the unity contest page.
You can even try my beauuutifullll Unity lightning demo:

I only work on it 1 big day and a half. I should have worked a little more to ensure me a victory but my other job eat me all my time.
My Unity project will be delivered for free at the end of the contest !
I will post a link of the Unity package with all the source code in this blog for everyone who want to download it !
The code is clean, and commented. I made a framework to easily draw multiple line. So you will be able to use it for other projects if you want, or take it as an example.
Good job! I use it in my project.
Thunder.cs Line 291 gives you a runtime null reference if you don have camera.main.
I replaced it with Vector3.zero. Can’t tell if it makes a difference.
Without the code near my eyes, I would say: I think that I need the camera to make a billboard effect (Polygone always face the cam) . It will still look good with Vector3.zero if you don’t look too close to the lighning.
I wasn’t aware that camera.main can be null. When the camera.main is null ?
And what is your project (to feed my curiousity)?
i only have a player camera. i can replace the line with my camera. star wars. muha
keep me up-to-date of your project.
I’m very curious.
cheers
Alexandre
Wow. This effect seems great!
I want to use it.
But I can’t find download link.
Could you share it? If do, It will be very helpful for me.
The contest website is down, so I upload it on my own website. You can get it here:
http://www.wildfactor.net/Upload/Thunder.unitypackage
Nice job on this one, it looks great. Is there a way to keep the lightning anchored to the parent object? I’ve found that if the parent object moves, the lightning seems to get separated from the parent object. I tried setting the start and end points in an Update() function, but that didn’t work.
Hi Dave.
I’m not sure I understand you, but:
if you want to move lighting you just have to change the position of start point game Object and end point game Object.
For optimisation reason the lighting gameobject shouldn’t move (avoid matrix recalculation) and I don’t think there is a strong reason to want to do it (unless you want to make your object hierarchie more “tidy”).