So i am using lerps to show trajectory of a projectile with trail, creating almost perfect bullet trail. But for some reason, projectile with the trail spawns somewhere else then its supposed to. Here’s a video of the trail starting basically in the middle of whole trajectory:
I have a starting part for the projectile wielded like this:
and this is my lerping script:
local function lerp(a,b,t)
return a + (b-a) * t
end
local function linearLerp()
local projectileC = projectile:Clone()
projectileC.Anchored = true
projectileC.CanCollide = false
projectileC.CFrame = CFrame.new(firePart.Position)
projectileC.Parent = workspace
local start = firePart.Position
for i = 0,6,1 do
local t = i/6
local linear = lerp(start,currentTarget.PrimaryPart.Position,t)
projectileC.CFrame = CFrame.new(linear)
task.wait()
end
game:GetService("Debris"):AddItem(projectileC, 1)
end