I’ve been trying to find a fix for this for some time, sadly i got none.
In case of curiosity, this also happens to every projectile.
Low fps example: https://gyazo.com/76525f018fdc4fcd6598370b5a150b83
High fps example: https://gyazo.com/929ad091d4ef18c58206a49a017bc839
the code…
local replicatedStorage = game:GetService('ReplicatedStorage')
local tweenService = game:GetService('TweenService')
local events = replicatedStorage:WaitForChild('Events')
local assets = replicatedStorage:WaitForChild('Assets')
local modules = replicatedStorage:WaitForChild('Modules')
local cratterModule = require(modules.CratterModule)
local function Lerp(a, b, c)
return a + (b - a) * c
end
local function CalculateQuadBezier(Iteration, StartPosition, MiddlePosition, EndPosition)
local FirstLerp = Lerp(StartPosition, MiddlePosition, Iteration)
local SecondLerp = Lerp(MiddlePosition, EndPosition, Iteration)
local FinalLerp = Lerp(FirstLerp, SecondLerp, Iteration)
return FinalLerp
end
return function(unit:Model, enemy:Model, originalCFrame:CFrame)
local primaryPart = unit.PrimaryPart
local E_primaryPart = enemy.PrimaryPart
local lookAt = tweenService:Create(primaryPart, TweenInfo.new(0.2, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {CFrame = CFrame.lookAt(primaryPart.Position, Vector3.new(E_primaryPart.Position.X, primaryPart.Position.Y, E_primaryPart.Position.Z))})
lookAt:Play()
local middle = (primaryPart.Position:Lerp(E_primaryPart.Position, 0.5)) + Vector3.new(0, 10, 0)
task.wait(1.5)
unit.Torso.Trail.Enabled = true
for t = 0, 1, 0.025 do
primaryPart.CFrame = CFrame.new(CalculateQuadBezier(t, originalCFrame.Position, middle, E_primaryPart.Position)) * CFrame.Angles(0, math.rad(180), 0)
task.wait(0.01/60)
end
cratterModule.Create(3, E_primaryPart.Position, 1)
primaryPart:WaitForChild('SFX').Fall:Play()
unit.Torso.Trail.Enabled = false
task.spawn(function()
enemy.PrimaryPart.RootAttachment.DMGTaken.Enabled = true task.delay(0.2, function() enemy.PrimaryPart.RootAttachment.DMGTaken.Enabled = false end)
end)
task.wait(0.6)
local lookAt2 = tweenService:Create(primaryPart, TweenInfo.new(0.2, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {CFrame = CFrame.lookAt(primaryPart.Position, Vector3.new(originalCFrame.Position.X, primaryPart.Position.Y, originalCFrame.Position.Z))})
lookAt2:Play()
local animation2 = unit.Humanoid.Animator:LoadAnimation(unit.Return)
animation2:Play()
task.wait(1.05)
unit.Torso.Trail.Enabled = true
for t = 0, 1, 0.025 do
primaryPart.CFrame = CFrame.new(CalculateQuadBezier(t, E_primaryPart.Position, middle, originalCFrame.Position))
task.wait(0.01/60)
end
cratterModule.Create(3, originalCFrame.Position, 1)
primaryPart:WaitForChild('SFX').Fall:Play()
unit.Torso.Trail.Enabled = false
task.wait(0.5)
local lookAt3 = tweenService:Create(primaryPart, TweenInfo.new(0.2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {CFrame = originalCFrame})
lookAt3:Play()
end