Still have questions? Join our Discord server and get real time help.
Log in to vote

Why wont my bullet be fired from my gun?

Asked by 8 months ago

I am making a gun and I need a bullet system. I made a simple one but it seems like the bullet just wont fly. It gets stuck mid-air. I tried to unanchor it, nothing. Maybe its a ROBLOX bug?

It wont work in studio and in-game.

function GetBullet()
    local p ="Part", workspace)
    p.Size =,.5,.5)
    p.Shape = Enum.PartType.Ball
    p.BrickColor ="Bright yellow")
    p.Material = "Neon"
    p.CanCollide = false
    p.Anchored = false"BodyVelocity", p)
    return p

    if canShoot == true and isInspecting == false and isSprinting == false then
            local mH = mouse.Hit
            local bullet = GetBullet()
            bullet.CFrame = cam:FindFirstChild("MOSINNAGANT").MOSINNAGANT.Fire.CFrame * * 2)
            bullet.CFrame =, mH.p)
            bullet.BodyVelocity.velocity = bullet.CFrame.lookVector * 120
                local huma = hit.Parent:FindFirstChild("Humanoid")
                if huma then
            end) --The end thing is correct, dont bother correcting it. I have a script after this that makes the gun flash and everything. Dont want to post too much about my gun lol

Answer this question