Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

My Bullet Floats Straight Up?

My Bullets just float straight up into the sky when I shoot

plr = game.Players.LocalPlayer
enabled = true
waittime = 0.1
button = script.Parent

function Fire()
	if enabled then
		enabled = false
		p = Instance.new("Part",workspace)
		p.Name = "Bullet"
		p.BrickColor = plr.TeamColor
		p.CanCollide = false
		p.TopSurface = "Smooth"
		p.BottomSurface = "Smooth"
		p.FormFactor = "Custom"
		p.Size = Vector3.new(0.2,0.2,6)
		mouse = plr:GetMouse()
		pos = script.Parent.Handle.Position
		focus = mouse.Hit.p
		p.CFrame = CFrame.new(pos,focus)
		p.CFrame = p.CFrame+p.CFrame.lookVector*5
		v = Instance.new("BodyVelocity",p)
		v.maxForce = p.CFrame.new(4000,4000,4000)
		v.Velocity = p.CFrame.lookVector*250
		wait(waittime)
		enabled = true
	end
end

script.Parent.Activated:connect(function()
	Fire()
end)

1 comment

0

My Bullets just float straight up into the sky when I shoot

1 answer

I'm not good with these type of things, but I think it's something to do with your BodyVelocity. It's probably set up wrong, so instead of the bullets going straight, they go up.

This discussion is preserved as it was. New answers, comments, and votes are closed.