Issue is my math isn’t that good with this so i need help adjusting it to work
What solutions have you tried so far?
Going around devforum to see how other people were doing it
local CF = info.CF -- Stand's HumanoidRootPart's CFrame
local function TweenArms(BarrageArm)
local Bezier_Module = {}
function Bezier_Module:QuadraticBezier(Time,Point0,Point1,Point2)
return (1-Time)^2*Point0+2*(1-Time)*Time*Point1+Time^2*Point2; --This'll give you that curve you were looking for :)
end;
local PivotCf = CF * CFrame.new(0,0,math.random(-12,-6))
local rnd = Random.new()
local rndCF = CFrame.new(rnd:NextInteger(-5,5),rnd:NextInteger(-5,5),rnd:NextInteger(-10,10))--rnd:NextInteger(-6,6))
task.spawn(function()
local TweenDelay = task.wait()
for i, v in ipairs(BarrageArm:GetDescendants()) do
if v:IsA("BasePart") then
task.delay(.4, function()
TweenModule.obj(v, "Quint","Out", .1, {Transparency = 1, Size = Vector3.new(0,0,0)})
end)
end
end
for i=1,10 do
local t = i/10
local Pos = Bezier_Module:QuadraticBezier(t, CF.Position, (CF*rndCF).Position, PivotCf.Position)
local Direction = Bezier_Module:QuadraticBezier(t+1, CF.Position, (CF*rndCF).Position, PivotCf.Position)
TweenModule.obj(BarrageArm.PrimaryPart, "Quad", "Out", TweenDelay+.06, {CFrame = CFrame.new(Pos, Direction)})
task.wait()
end
BarrageArm:Destroy()
end)
end
for i=1, 2 do
local Arms = (i%2==0) and ReplicatedStorage.Effects["Star Platinum"].LeftHand:Clone() or ReplicatedStorage.Effects["Star Platinum"].LeftHand:Clone()
Arms.PrimaryPart.CFrame = CF * CFrame.new(0,0,-6)
Arms.Parent = workspace.Effects
TweenArms(Arms)
task.wait()
end