Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can someone help me work out this projectile bug?

Asked by
Supint 60
8 years ago

http://i.gyazo.com/5a37894a4041bd7df1c004ad54b5fe30.png

When this parabola is being made, right at the beginning it goes up just a tad and falls back down.

I'm trying to figure out why it jumps up and then falls back down. I just want it to go straight and fall down.

Here is the raycasting code. Can someone tell me what my problem is?

while true do
t = t + wait()
    local new_pos = v3(part_pos.X + (muzzle_velocity)*t + 10,(last - workspace.BasePlate.Position).Y - (45*(t*2)),0)
    local ray = Ray.new(last, (new_pos - last))
    local hit, pos = workspace:FindPartOnRay(ray)
    last = new_pos
    print(hit, pos)
end

Answer this question