Bullet kept falling down and doesn't point to mouse

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want my parts to stop falling even though I made it massless.

  2. What is the issue? Include screenshots / videos if possible!
    The part kept falling. I thought it was network owner but I was wrong.


    (The part is actually falling down.)
    Imgur: The magic of the Internet

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I looked for solutions but none of them fits.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

        local bullet = Instance.new("Part")
		bullet.Name = "Bullet"
		bullet.CanCollide = false
		bullet.Anchored = false
		bullet.Massless = true
		bullet.Size = Vector3.new(0.1, 0.1, 1) --Vector3.new(0.02, 0.02, 0.045)
		bullet.CFrame = CFrame.new(MuzzlePos, MousePos)
		bullet.Material = Enum.Material.Neon
		bullet.BrickColor = BrickColor.new("Cool yellow")
		bullet.Parent = workspace
		print("Step 1 done.")
		--bullet:SetNetworkOwner(player)
		print("Step 2 done.")
		
		--bullet.AssemblyLinearVelocity = (bullet.CFrame.LookVector * 100)
		local bodyVelo = Instance.new("BodyVelocity")
		bodyVelo.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
		bodyVelo.Velocity = (-bullet.CFrame.LookVector * 100)
		bodyVelo.Parent = bullet
		
		--local bodyForce = Instance.new("BodyForce")
		--bodyForce.Force = Vector3.new(0, workspace.Gravity * )
		
		print("Success.")

The script above is placed in a server script. Triggered when someone shoots.

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

2 Likes

You can just use the Anchored property of the part?

2 Likes

Bro. You can’t. If the part is anchored it will not move. Also, when I checked, it’s not the body velocity. It’s the mouse. And I’m trying to get the mouse using UserInputService (if possible) because I don’t think mouse.Hit should be used anymore.

2 Likes

Hmm are you using a custom equip system on the client? If so only that person will see the gun and others can only see the bullets because it is on the server.

1 Like

You must account for workplace gravity on the Y axis also it’s better to use linear velocity for this anyways

1 Like

If you meant the constraint, I haven’t tried it (I will) but if you meant the AssemblyLinearVelocity. It’s the same

Edit : Everything is the same!!!

1 Like

Correct.

One two three four five six seven eight nine ten One two three four five six seven eight nine ten One two three four five six seven eight nine ten

1 Like

No I mean just the linear velocity property

1 Like

If it is on the client it won’t be visible to other players. I suggest using the server for this.

1 Like

as i said, it’s the same

12214353523567123651235793285738512605165

1 Like

the bullet is server sided, the viewmodel and muzzle and mouse pos stuff is client

1 Like

Are you talking about the bullets falling down or the gun itself?

1 Like

Bullet. If the gun is falling I would show the gun script.

1 Like

I set the gravity to 0 and behaves the same. I don’t think it’s gravity

1 Like

I made a raycast and the mouse position is different than the original one

It doesnt work neither

1 Like

Sorry for the previous replies, I have tested this script myself and couldn’t really find an issue with your original script, is this the entire script? However I suggest you set the network to the server instead of the player as the bullet will stop when the player deloads the bullet, it can also be abused by exploiters.

1 Like

Is your script the exact same as mine?
If so, how did youfind the mouse position? I find it with the classic
( player:GetMouse().Hit.Position )

1 Like

I did not find the mouse position I instead set the CFrame to a location which wouldn’t affect the script itself. However yes, that is what you use for the mouse position.

1 Like

bro. its not the cframe problem. it’s the mouse position problem.

Can you explain with a little bit more detail? player:GetMouse().Hit.Position returns a Vectror3 value of where the mouse is pointing at the 3D Space. You can just do CFrame.new(MousePos) to get a CFrame, I see you were going for CFrame.new(MuzzlePos, MousePos) but that is probably causing the issue.

1 Like