Is it possible to my highly randomized lightning strike end at a specific point?

I want to add another parameter to my lightning strike function that makes the strike come to a specific point. (for example, a lightning rod or person) How would I do that? Is it even possible?

I might as well give the place (feel free to mess around with the settings :slight_smile: ) (they’re in the script in workspace)
lightning.rbxl (46.5 KB)

I’ve seen quite a few posts about lightning effects and beams over the years. Maybe check them out to see how those people accomplished it.

1 Like

If you want the lightning to end at a specific point, it may actually be best to start the generation of the lightning at that point, then it just ends at a random position in the sky.

2 Likes

Good point… The only bad this is it uses raycasts to detect if it hits something, which means that it’s raycasting in reverse order (bottom to top)

So this means that if I set the point to be inside a building then it will probably go through the ceiling

You can use Raycast result to get the location the ray actually hits and end the lightning at that point.
EDIT, Nvm, I read that wrong.

raycast directly upwards until there is no longer an object, then have the lightning start/end at the new raycast position

1 Like