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

Can someone explain why my gun bullet doesn't go straight? [Unanswered]

Asked by
Relatch 550 Moderation Voter
9 years ago

This is a part of my gun script, which obviously shoots the bullet. I've tried many things, but this bullet will not go straight. Instead, it's turned sideways. Help? I also get no errors whatsoever.

function fireBullet(d)
    local bullet = Instance.new("Part")
    bullet.FormFactor = "Custom"
    bullet.Size = Vector3.new(1.5, 0.35, 0.35)
    bullet.BrickColor = BrickColor.new("White")
    bullet.Position = tool.Handle.Position + (d * 5)
    bullet.Velocity = d * 125

    local s = script.RemoveBullet:Clone()
    s.Disabled = false
    s.Parent = bullet

    local BrickMass = bullet.Size.X * bullet.Size.Y * bullet.Size.Z
    local BrickWeight = BrickMass * 196.2

    local force = Instance.new("BodyForce")
    force.force = Vector3.new(0, BrickWeight, 0)
    force.Parent = bullet

    bullet.Parent = game.Workspace
end
0
Just rotate it..? alphawolvess 1784 — 9y

Answer this question