How could I make my knife like murder mystery 2 knife?

So I’m making a knife system for my game, and I was wondering how I could make my knife like the game murder mystery 2 knife, I have my knife fully done (finally) but when you throw a knife it comes from the head (which I set lol) but in murder mystery 2 it comes from the hand but ends where you are aiming. I am assuming I’d change the ray stuff? I could show my code if needed.

1 Like

Yes, coudl you please share your code?

Also the solution might be to start the ray from the hand

Okay, I’ll send the RAY code.

local script sending aim args (i havent go this 2 good tbh)

RemoteEvent:FireServer("Throw", {X= Mouse.x, Y= Mouse.y, Aim= Mouse.Hit.p})

script code actually throwing knife…

script.Parent.Handle.Throw:Play()
		local ThrowPart = script.Parent.Handle:Clone()
		ThrowPart.CFrame = Player.Character["Head"].CFrame
		ThrowPart.Parent = workspace
		ThrowPart.AssemblyLinearVelocity = (Args.Aim - ThrowPart.CFrame.p).unit * 200
		local floatingForce = Instance.new("VectorForce")
		floatingForce.Force = Vector3.new(0, 196.2 * ThrowPart:GetMass(), 0)
		floatingForce.RelativeTo = Enum.ActuatorRelativeTo.World
		local attach0 = Instance.new("Attachment")
		floatingForce.Attachment0 = attach0
		attach0.Parent = ThrowPart
		floatingForce.Parent = ThrowPart
		ThrowPart.AssemblyAngularVelocity = Vector3.new(-ThrowPart.AssemblyLinearVelocity.Z, 0, ThrowPart.AssemblyLinearVelocity.X) * 10
		ThrowPart.Parent = workspace
		game.Debris:AddItem(ThrowPart, 5)
		ThrowPart:SetNetworkOwner(Player)

		local function FinishedThrowing(Hit)
			ThrowPart.Anchored = true
			if Hit then
				if Hit:FindFirstChild("Humanoid") then
					HitPlayer(Hit.Humanoid, game.Players:FindFirstChild(Player.Name))
				end
			end
		end

		local raycastParams = RaycastParams.new()
		raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
		raycastParams.IgnoreWater = true

		local raycastResult = nil
		local StartPosition = script.Parent.Handle.Position
		while not raycastResult do
			local mag = (ThrowPart.CFrame.p - StartPosition).magnitude
			local direction = (ThrowPart.CFrame.p - StartPosition).unit * mag

			raycastParams.FilterDescendantsInstances = {Player.Character, ThrowPart}
			raycastResult = workspace:Raycast(StartPosition, direction, raycastParams)
			if raycastResult then
				local Part, position = raycastResult.Instance, raycastResult.Position
				print(tostring(ThrowPart.Velocity))
				local CF = CFrame.new(ThrowPart.CFrame.p, ThrowPart.CFrame.p + ThrowPart.Velocity) * CFrame.Angles(math.rad((-30 * 4)), 0, 0)
				local Target = GetHuman(Part)
				if Target then
					if Target ~= Player.Character then
						CF = CF:toObjectSpace(Part.CFrame)
						FinishedThrowing(Target)
					end
				else
					ThrowPart.CFrame = CF
					FinishedThrowing(Part)
				end
			end
			StartPosition = ThrowPart.CFrame.p
			wait()
		end
	end

not sure how much you need so just sent all of the throw stuff lol.

In your code you set your ThrowPart’s CFrame to the player’s head.

perhaps you could replace this with the hand’s CFrame, or even the tool’s handle’s position (omitting the line entirely)

But then there is an offset, and in murder mystery 2 as it is traveling it moves to where you where aiming well coming off of the right hand

With removing the code above, it has a heavy offset.

Do you mean it is being offset from where you clicked?

Yes, like 0-20 studs depending on the distance.