Lightning Arc Creator

Procedural mesh generation and maniuplation

boltImage

The above image is a sample of what the below script can be used to create. Developers can place the script on an object in Unity, and specify another object as the end point, and the script will create a lightning arc style effect out of a procedurally generated mesh. The number of points, the distance between the points, and the speed at which it animates are all easily settable within the Inspector. Upon moving either of the two points assigned as the start and end of the bolt, it will regenerate the mesh with the same settings and restart the animation process as well.


The code can be seen below, or downloda the file here.