How do I make a squiggly lightning bolt effect?

So idk how to really explain this correctly but the lines from the lightning are confusing to me. I’ve never done something involving positioning parts perfectly aligned with eachother, then scaling the position with rotation. How can I do this so that the rotation is random, but always aligns with the lightning?

image

4 Likes

Is this what you’re looking for? Electric Arcs Effect

4 Likes

Not really, I’d rather figure out how to do this effect myself than use someone’s module. I’m sure there are simple methods out there for this sort of script, plus I want to add my own effects to it and I’m not on that module’s level yet.

1 Like

the way I would do it is by getting a starting point and an end point.


then I would get the distance between both points and divide that into different points
image
then randomize each points position by like 2-3 studs besides the start and end point
image
lastly connect all the points together with parts and profit?
image

–I tried this out and this is what I got after I added effects of course–
https://gyazo.com/549ecf3ee0f5328f429baa144b5372db

48 Likes

How did you make that effect? Do you mind showing?

He literally made diagrams explaining how he did it. Is there something specific you don’t understand?

4 Likes

I meant the scripting behind it, i thought that was pretty obvious, but apparently not.

1 Like

I tried scripting it, but couldn’t get the rotation correct. Not all of us are great at math.

Use CFrame.fromMatrix with the unit vector of the offset from start to end as one of your directional vectors.
OR
Use the deprecated method CFrame.new(position, lookAt) with the position being the average of two nodes and the lookAt being one of the nodes.

1 Like

I’ve tried executing your method but my issue as u can tell from that picture is the parts not being connected well, do u mind telling me how would I fix it

This happens because the method you are using works like lots of 1D lines are connected and then parts are being build up, so each part will be onnected at the center of their faces. To change this you can try changing the part created to cylinder and add a sphere on the part where they are joined (you should think of removing the transparency in order for it to look nice). Another way is to try adding wedges until the gap is filled, but this can be laggy and slow. Lastly you can add particles instead of parts and if you choose the right settings it will be much cooler than what LuaDeveloped made!

You can use attachments and beams