Why does my physics projectile not go straight and never stop after hitting the ground?

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)
1 Like

Part of your issue is that these are two different projectiles with two different scripts.
For the first one, your script is using game.ServerStorage.Proj. That projectile has a BodyVelocity set to a non-zero value, so it will continue to move long after your impulse is applied. You should remove the BodyVelocity or set it to 0.
For the second one, your script is using game.ServerStorage.Proj2, which has a BodyGyro set to a non-zero value. This will cause your projectile to turn. You should remove the BodyGyro or set it to 0.

2 Likes

This didn’t work and the same problem still occurs, what else should I do?

1 Like

I would try asking a teacher or member of staff.

1 Like