https://gyazo.com/e4a3e9d77dcfa22cfac031f51c6e5501
Here is my code (and maybe a poor attempt at creating proportional guidance). I have no idea why sometimes it just freaks out, jitters, or misses and freaks out. Is there a way to make it smoother/not go berserk?
while true do
wait(0.001)
local TTI = (target.Position - lookpart.Position) / lookpart.AssemblyLinearVelocity
local hitPos = target.Position + target.AssemblyLinearVelocity * TTI
lookpart.CFrame = CFrame.new(lookpart.Position, hitPos)
lookpart.LinearVelocity.VectorVelocity = lookpart.CFrame.LookVector * maxspeed
if (target.Position - lookpart.Position).Magnitude < 100 then
lookpart.CFrame = CFrame.new(lookpart.Position, target.Position)
end
target.Touched:Connect(function()
lookpart:Destroy()
target:Destroy()
print("HIT!")
end)
end