Help with mm2 knife on console

Hi there,

I am creating a knife system similar to MM2. However, I am working on console compatibility and cannot seem to get the knife to throw on console. I have tried searching on YT and deconstructing free models, but they all only work on pc.The code is below. Any help is appreciated.

Thanks
Farmboy014

print("ConsoleThrow")
			local Knife = plr.Character:FindFirstChild("Knife"):FindFirstChild("Handle"):Clone()
	
			Knife.Parent  = workspace
			Knife.Name = plr.Name.."'s Knife"
			
			local sound = Instance.new("Sound",Knife)
			sound.SoundId = ThrowSound
			sound:Play()
			
			local character = plr.Character
			local HRP = character:WaitForChild("HumanoidRootPart")
			local Direction = (HRP.CFrame.LookVector + HRP.CFrame.UpVector) * 100
			
			local VF = Instance.new("VectorForce",Knife)


			local Attach = Instance.new("Attachment",Knife)
			VF.Attachment0 = Attach
			VF.ApplyAtCenterOfMass = true
			VF.RelativeTo = Enum.ActuatorRelativeTo.World
			VF.Enabled = true
			VF.Force = Direction

2 Likes

What is the key bind? Ive found that the Thumbstick 1 and 2 key codes never seem to work for me, so that might be the issue.

They keybind is LT. RT works for the stab script.

So it’s not a problem with the part of the script handling the knife if it works for pc, so could I see the part where you actually get the users input and call the function?

Absolutely.

--The control script
elseif Key.KeyCode == Enum.KeyCode.ButtonL2 then
			ThrowKnife(Tool)
		
		end
--Function
local function ThrowKnife(tool)
	if debounce then return end
		
	if UIS.KeyboardEnabled == true  then
		ThrowEvent:FireServer(Player:GetMouse().Hit,"Throw","PC")
		
	elseif UIS.GamepadEnabled == true then
		ThrowEvent:FireServer(nil,"Throw","Console")
	
	end
	
end
1 Like

PC Slightly is different because I use mouse position, and for console I’m using humanoidrootpart lookvector and upvector

1 Like

Are you unable to use the mouse for console or something?

1 Like

There is no mouse on console except for the virtual cursor, unless I am wrong.

1 Like