Issue with UserInputService:JumpRequest and custom characters

I’ve recently added custom characters to my game and for some reason I realised that the UserInputService:JumpRequest event doesn’t work anymore.

Here’s a little test I made:
Server Script

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Once(function(char)
		task.wait(5)
		local newChar = script.NewChar:Clone()
		newChar.Parent = game.Workspace
		
		plr.Character = newChar
	end)
end)

Local Script

-- Services
local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")

-- Constants
local Plr = Players.LocalPlayer

-- Variables and Functions
local jumpEvent = nil
Plr.CharacterAdded:Connect(function(char)
		if jumpEvent then
		jumpEvent:Disconnect()
	end
	jumpEvent = UIS.JumpRequest:Connect(function()
		print("jump request")
	end)
end)

Once the character is changed by the server script, the JumpRequest event breaks completely.
If anyone has any idea to fix this please let me know!

1 Like

I don’t think it does a callback so you would need to do

UIS.JumpRequest = function()

print("hey")

end

1 Like

No it doesn’t work that way, you have to use UIS.JumpRequest:Connect(function)

Using this method fix the issue

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.