[Effect] v1.1 Lightning Beams: Seamless, smooth and procedurally animated with beam-like properties

will it be more understandable for builders that dont understand scripts to change it?

2 Likes

Would you be able to give a repro file for the lightning strike video?

Yeah, this would be really helpful if you could provide it @Quasiduck .
Other than that, this is super amazing!

6 Likes

I was just about to suggest using mesh skinning and a part cache. Creating large amount of parts is very tedious, I had to setup a part cache for certain guns that had busted fire rates in my game to prevent the drop in frames.
Edit: excited to see v2 and the performance boosts!

2 Likes

Amazing module! However, it only works when I run it in studio. It doesn’t work when I play test it or go in game. How do I fix this?

2 Likes

sorry but how do i make it so every one can see cus when i create it in the server side it can only be seen in the server i dont get it

Edit: it works now MoonlightAnim is right u just go inside the module and change the parent toa folder inside workspace :smiley: btw nice module

2 Likes

Graphical effects like this should be run from the client, not from the server. You can set up the module on the client and then have the server broadcast wherever effects need to happen, then pick that event up client-side and invoke the module with that.

24 Likes

The spark module doesn’t seem to be working, on the first test place with 1 beam. I’ve tried playing around with the properties, to no avail.

1 Like

Are you talking about the explosion?

2 Likes

No, I’m talking about the module titled “LightningSparks.”

1 Like

This is phenomenal. I’ve seen a lot of fancy creations in my days here, and most of the time I get a “Hey that’s cool”, or for the good stuff I go “Damn that’s awesome”. This is one of the very few that has made me flat out yell from the visual style.

Outstanding work. I plan to adapt this for my own games, likely mixing in PartCache to improve performance of the part-based lightning (at least, until you finish the release of V2, and assuming it’s even necessary - I’ve yet to view the code). The fact that you have open sourced this module is something I greatly respect, and I look forward to seeing your future work.

8 Likes

This module is great, I’ve been using it in a few games here and there and it has come in extremely handy, thanks.

2 Likes

I was thinking the same lol, I’ve never seen this before

4 Likes

Really love this! Just looking for an easier to use version! My head hurts from the math… ;(

1 Like

why i have this problem?
look at the difference game,studio

Game:https://gyazo.com/d535965c6ed9040619c8650f3784db82

Studio:https://gyazo.com/3283c9a29f6644f0087d5c59a6283ae1

6 Likes

Looking inside the “LightningBolt” Module, There is a small tip saying:

--Small tip: You don't need to use actual Roblox Attachments below. You can also create "fake" ones as follows:
--[[
local A1, A2 = {}, {}
A1.WorldPosition, A1.WorldAxis = chosenPos1, chosenAxis1
A2.WorldPosition, A2.WorldAxis = chosenPos2, chosenAxis2
local NewBolt = LightningBolt.new(A1, A2, 40)
--]]

In my opinion, this isn’t properly explained, because when i tried this out, it came as a error saying:
“ReplicatedStorage.LightningBolt:88: attempt to perform arithmetic (mul) on nil and number”
This is my code:

local LightningBolt = require(game.ReplicatedStorage.LightningBolt)
local LightningSparks = require(game.ReplicatedStorage.LightningBolt.LightningSparks)
local LightningExplosion = require(game.ReplicatedStorage.LightningBolt.LightningExplosion)
local A0,A1 = {},{}
A0.WorldPosition,A0.WorldAxis = Vector3.new(0,0,0),Vector3.new(1,0,0)
A0.WorldPosition,A0.WorldAxis = Vector3.new(0,50,0),Vector3.new(1,0,0)


local NewBolt = LightningBolt.new(A0, A1, 40)
NewBolt.CurveSize0, NewBolt.CurveSize1 = 10, 15
NewBolt.PulseSpeed = 2
NewBolt.PulseLength = 0.5
NewBolt.FadeLength = 0.25
NewBolt.MaxRadius = 1
NewBolt.Color = Color3.new(0.745098, 0.980392, 1)
local NewSparks = LightningSparks.new(NewBolt)
2 Likes

I Fixed my own problem, all i needed to do is:

local A0 = {
	WorldPosition = Vector3.new(0,0,0),
	WorldAxis = Vector3.new(0,0,0)
}
local A1 = {
	WorldPosition = Vector3.new(0,50,0),
	WorldAxis = Vector3.new(0,0,0)
}

local NewBolt = LightningBolt.new(A0, A1, 40)
NewBolt.CurveSize0, NewBolt.CurveSize1 = 10, 15
NewBolt.PulseSpeed = 2
NewBolt.PulseLength = 0.5
NewBolt.FadeLength = 0.25
NewBolt.MaxRadius = 1
NewBolt.Color = Color3.new(0.745098, 0.980392, 1)

For some reason the way this was explained was wrong and will cause a error???
I would recommend putting the “WorldAxis” and “WorldPosition” inside the table

3 Likes

I believe you made a typo here, you forgot to edit the second table A1 and instead copied it over to A0 instead. Just a small mistake,. It should be:

A0.WorldPosition,A0.WorldAxis = Vector3.new(0,0,0),Vector3.new(1,0,0)
--A1 here
A1.WorldPosition,A1.WorldAxis = Vector3.new(0,50,0),Vector3.new(1,0,0)
4 Likes

It seems that when ran on the server, the lightning doesnt show on the client… so using a ServerScript for creation wont work, this can only be achieved on the client if ran on a LocalScript by Client Replication, do you think there should be a function that automatically client replicates when ran on a server script?

1 Like

You shouldn’t do it like that anyway as it unnecessarily uses server resources + the effect would only run as fast as the rate at which you receive data from the server and so will appear ‘jumpy’ at times.

I can’t assume what frameworks/modules others might use for replication. It would potentially create an inconsistency within their framework. Also, I don’t want to force how users want to set up their replication → For example, they might want to use string.pack to send over replication data or might not want to send any extra data at all as they instead want some electricity “door” (with pre-defined Lightning properties) to just open/close.

The ideal setup for replication is mentioned in the solution of this post.

4 Likes

titan shifting is perfect now THANKS!

2 Likes