Best way to create a lightning effect?

\Hey! so I’m making a game with different magic types. I plan on making Lightning one of them.
Quick question is how do games like demonfall make their lightning effects? I would assume a tweened part with a trail but maybe there is a better way I’m unaware of which is why I made this post.
I’ve been having some trouble trying to think of the best possible way.
only method I could think of being viable is parts with trails as I mentioned before.

Let me know how you’d make a lightning effect.

Sorry for being late! I noticed this post minutes after it was posted but I was not a member yet. Hope my response is good!

also this is probably not how professional games do it but this is a simple version that I would make.

So first you would probably want to make a layout similar to this:


I didn’t try to make it look like lightning because I did not want to spend too much time working on the example, btw.

Then to make it appear out of nowhere you would want to put it in game.ReplicatedStorage
and add a sound to it, and call it “Strike”. I recommend you use the roblox sound ID 7138705968, but It might not be moderated yet because I just made it right now.

Now you want to make a script and put it anywhere in the game and just put this code into it:

-- This should work.

-- Lightning location V
local Lightning = game.ReplicatedStorage.Lightning
-- Lightning location ^


-- Position here V
local Vector = Vector3.new(0,30,0)
-- Position here ^

-- Strike sound V
local Strike = Lightning.Strike
-- Strike sound ^

-- V Do whatever you want to activate it here V
wait(6)
-- ^                                          ^

-- Boom!
local LightningC = Lightning:Clone() do
	LightningC.Parent = workspace
	LightningC.Position = Vector
	Strike:Play()
	wait(1)
	LightningC:Destroy()
end

Hope this helps you!

Sorry if this is bad I’m new to the roblox devforums.

2 Likes

Don’t tween, it’s expensive. Try making a beam or some particles.

Although this is an incredible solution unfortunately its not exactly what I’m looking for.
I do appreciate all the time you took to do all that though.

I probably should’ve provided a visual of demonfalls lightning effects as that is the type I am aiming for.
https://gyazo.com/408b513214290e3d504062ac3b8bdde0

(i assume u dont know about this) demonfall used the lightningspark module script inside this lightning beam module script:

2 Likes

:wave: Hey! The best possible way to create a lighting effect is through the use of Beams, combined with Particle Emitters and the use of a few tricky visual effects to make it look a bit more realistic.
Here I made a quick lighting effect that is much better than just a part striking down.

7 Likes

how did you find the image for the beam!?! every time i search the toolbox i cant seem to find one that looks as good as yours. could you send me the decal id for it?

1 Like

texture id of the beam please!!!

1 Like