Tweens are smoother considerably than incrementing values in for loops, everybody knows that. I have been replacing lot's of incrementing values with for loops with tweens. However, the size of the blast is sin() dependant, so how would I translate the below loop in the below function, for example, into a tween?
function MakeBlast(Position, Color)
local Blast = Instance.new("Part", SpellsFolder)
Blast.Anchored = true
Blast.Shape = Enum.PartType.Ball
Blast.CanCollide = false
Blast.CastShadow = false
Blast.Material = Enum.Material.Neon
Blast.Color = Color
Blast.Position = Position
local Blast2 = Blast:Clone()
Blast.Transparency = 0.2
Blast2.Transparency = 0.4
Blast2.Parent = Blast
spawn(function()
for i = 0, 40, 1 do
Blast.Transparency = Blast.Transparency + 0.02
Blast2.Transparency = Blast2.Transparency + 0.015
local BSize = math.sin((math.pi/80)*i)*80/2.5
Blast.Size = Vector3.new(BSize, BSize, BSize)
Blast2.Size = Vector3.new(BSize+8, BSize+8, BSize+8)
wait()
end
Blast:Destroy()
end)
end
