I don’t know what to call this so I just called it this.
So I am trying to launch a projectile to a target but it misses.
local function PredictNextPosition(targetPosition, targetVelocity)
local targetPos = targetPosition + targetVelocity
local direction = targetPos - firePoint.WorldPosition <-- attachment
local duration = math.log(1 + direction.Magnitude * 0.01)
local force = direction / duration + Vector3.new(0, workspace.Gravity * duration * 0.5, 0)
return force
end
local force = PredictNextPosition(targetPosition, targetVelocity)
projectile.PrimaryPart:ApplyImpulse(force * projectile.PrimaryPart.AssemblyMass)
-- its a model
I don’t know why it is missing.