Knife floats when it sticks on

Okay, so I’ve been having more issues while I’m modifying the game but the knife floats when I throw it at a player/npc. I’m using welds and LinearVelocity so I don’t know if it’s accurate.


important part of the script

KnifeAnimation:GetMarkerReachedSignal("SpawnKnifeDagger"):Connect(function()
			Character.Humanoid.WalkSpeed = 6
			KnifeDagger = ReplicatedStorage.Assets.KnifeDagger:Clone()
			KnifeDagger.Anchored = true
			KnifeDagger.Parent = workspace
			local KnifeDaggerDebounce = false
			local UnseatheSound = script.KnifeUnsheathe:Clone()
			UnseatheSound.Parent = KnifeDagger
			UnseatheSound:Play()
			KnifeDagger.Touched:Connect(function(Hit)
				local Humanoid = Hit.Parent:FindFirstChild("Humanoid") or Hit.Parent.Parent:FindFirstChild("Humanoid")
				if Humanoid then
					if Hit.Parent.Name ~= Player.Name and Hit.Parent.Parent.Name ~= Player.Name then
						if not KnifeDaggerDebounce then
							KnifeDaggerDebounce = true
							AttackHitboxes.CreateHitbox(Character, KnifeDagger.Size, 25, true, Humanoid.Parent.HumanoidRootPart.CFrame)
							
							local Weld = Instance.new("WeldConstraint")
							Weld.Part0 = KnifeDagger
							Weld.Part1 = Hit
							Weld.Parent = KnifeDagger
							
							local BloodSound = script.BloodSound:Clone()
							BloodSound.Parent = Hit
							BloodSound:Play()
							
							local BloodParticle = script.Blood:Clone()
							BloodParticle.Parent = Humanoid.Parent.HumanoidRootPart
							BloodParticle:Emit(50)
							
							task.delay(5, function()
								KnifeDagger:Destroy()
							end)
						end
					end 
				end
			end)
			for i=1,27 do
				KnifeDagger.CFrame = Character["Right Arm"].RightGripAttachment.WorldCFrame
				task.wait()
			end
			Character.Humanoid.WalkSpeed = 16
			task.delay(3, function()
				if KnifeDagger or KnifeDagger.Parent ~= nil then
					KnifeDagger:Destroy()
				end
			end)
		end)
		
		KnifeAnimation:GetMarkerReachedSignal("ThrowKnifeDagger"):Connect(function()
			local KnifeThrowSound = script.KnifeThrow:Clone()
			KnifeThrowSound.Parent = KnifeDagger
			KnifeThrowSound:Play()
			KnifeDagger.VectorForce.Force = Vector3.new(0, KnifeDagger.Mass * workspace.Gravity, 0)
			KnifeDagger.Anchored = false
			KnifeDagger:SetNetworkOwner(Player)
			KnifeDagger.AssemblyLinearVelocity = (Character.HumanoidRootPart.CFrame.LookVector * 100)
		end)

Have you tried making the hitbox visible to see if it is making a hitbox for you vs the character?

Not yet. The part has a special mesh so I’ll remove it and see the hitbox.

So I checked the hitbox and I tested it without the mesh. But what I’m predicting is that when it gets welded, the object is actually in the air because it’s a server side object.

So as you can see, the hitbox is the same as the knife
Screenshot 2025-05-03 072236

This is me testing it.

I mean a hitbox for the player thats hit, do you only use the knife hitbox?

I only use the knife’s hitbox.

Maybe try setting the network owner to nil (the server) instead of the player

1 Like

The problem is that the knife is being welded to where it was from the server’s perspective, which is why it’s so far off.

When you hit a player with a knife, you’ll want to send a remote event to every client that tells them to create a copy of the knife that is then placed on the target locally.

1 Like

It did work, but the knife is not transitioning smoothly.