I'm working on a tool that fires a projectile to the player's mouse position. It uses a BodyVelocity with the direction of the projectile being fired (its lookVector):
local projectileDirection = projectile.CFrame.lookVector
local bVelocity = Instance.new("BodyVelocity", projectile)
bVelocity.Velocity = projectileDirection * 300
Naturally, when fired, the projectile is released and travels in a straight line until it touches a part, at which point it is destroyed. I'm looking for a way to give the projectile a more erratic trail, somewhat like a fork of lightning.
Originally I tried having a second part, which contained the projectile's trail, orbit the part with the BodyVelocity to replicate a corkscrew effect, but, while still providing some cool results, wasn't quite the look I was going for.
I've considered it would probably be possible to map a number of randomly-generated waypoints onto the projectile's path, but am yet to find a way to put that into effect.
Would this be a viable way of doing it? And if so, I'd appreciate a point in the right direction about how to go about executing it. Or are there any other methods that may be simpler/more effective? If at all possible, I'd like to keep using Roblox's physics rather than CFraming the projectile for ease of collision detection, but this isn't vital.
Thanks.

13 comments
do u wanna just cast lightning?
cos ull prob have to do that anyway in order to achieve ur goal
another options would be to randomly and repeatedly rotating the projectile before locking back to the mouse's hit position
@TheluaBanana I'm trying to replicate an effect similar to it, but not specifically that. I mentioned the "fork of lightning" because that has a similar shape to the effect I'm trying to make.
@TheluaBanana I tried rotating the projectile so it orbited around a second part, if that's what you mean. That created a corkscrew movement and wasn't quite what I wanted.
i meant rotating the projectile itself in a random way
@TheluaBanana That's a bit too vague; I can't make out exactly what you're suggesting.
hh
i mean like keep randomly turning the projectile in random, at random and constantly updating the body velocity's velocity
up till it hits a limit before redirecting itself towards the mouse hit
This seems to be pretty close to what you need? https://scriptinghelpers.org/questions/61374/how-can-i-apply-a-sine-wave-to-a-projectile#59749
@fredfishy Somewhat, but a sine wave has a very uniform pattern, so the projectile you've explained there has quite a rhythmic oscillation to it. It's not quite what I'm after for the same reason the as 'orbiting part' method I mentioned in my post; being that it's not erratic enough and doesn't give a sense of instability. Your post was a very interesting read, though!
@LukeSmasher, the maths for both is similar. Rather than choosing a consistently increasing t, choose one at random.