I want her float, her it that remains straight, how I make that?
local mouse = game.Players.LocalPlayer:GetMouse() --mouse.Move:connect(function() -- print(mouse.Hit.x) --end) mouse.Button1Up:connect(function() if game.Players.LocalPlayer.Character.Humanoid.Health > 0 then local bullet = Instance.new("Part", workspace.Debris) bullet.FormFactor = "Custom" bullet.TopSurface = 0 bullet.BottomSurface = 0 bullet.Anchored = false bullet.CanCollide = false bullet.Size = Vector3.new(0.1, 0.1, 1.8) bullet.Material = 'Neon' bullet.BrickColor = BrickColor.new('Daisy orange') local BodyForce = Instance.new('BodyForce') BodyForce.Parent = bullet bullet.BodyForce.force = Vector3.new(mouse.Hit.p) bullet.Name = game.Players.LocalPlayer.Name if workspace:FindFirstChild('Debris') ~= nil then bullet.Parent = workspace.Debris else local DebrisFolder = Instance.new('Folder', workspace) DebrisFolder.Name = 'Debris' bullet.Parent = DebrisFolder end bullet.Velocity = (mouse.Hit.p-bullet.Position).unit*100 bullet.CFrame = CFrame.new(game.Players.LocalPlayer.Character.AimPart.Position,mouse.Hit.p) end end)
I believe what you're looking for is a BodyVelocity, not a BodyForce. A body velocity, assuming it has a high enough MaxForce, will keep the bullet moving straight in one direction.
bullet.CFrame = CFrame.new(game.Players.LocalPlayer.Character.AimPart.Position, mouse.Hit.p) local BodyVelocity = Instance.new('BodyVelocity', bullet) BodyVelocity.Velocity = (mouse.Hit.p - bullet.Position).unit*10
However, if you insist on using a BodyForce, add the weight of the bullet to the Y axis of the force to counteract gravity, like this:
BodyForce.Force = Vector3.new(...) + Vector3.new(0, workspace.Gravity*bullet:GetMass(), 0)