Hi, I am trying to make a projectile using physics by following a tutorial here and I am wondering why when the projectile hits the ground and continues going until it hits something (and sometimes if it has enough force it wont stop after hitting something.) Second thing, I am wondering how I can make the projectile go directly straight instead of going up and curving. Thanks!
local pos1 = workspace.FromP.Position
local pos2 = workspace.ToP.Position
local direction = pos2 - pos1
local duration = math.log(1.001 + direction.Magnitude * 0.02)
pos2 = workspace.ToP.Position + workspace.ToP.AssemblyLinearVelocity * duration
direction = pos2 - pos1
local force
force = direction / duration + Vector3.new(0, 98.1 / 3.5, 0)
local clone = game.ServerStorage.Proj:Clone()
clone.Position = pos1
clone.Parent = workspace
clone:ApplyImpulse(force * clone.AssemblyMass)
clone:SetNetworkOwner(nil)