I’ve been using JumpRequest for jump cooldowns for my custom characters but it is no longer working. My characters are created on the server and then set to the player when ready, with the client side connections being set afterwards with CharacterAdded.
I’ve provided a repo file, this behavior doesn’t happen with default characters through :LoadCharacter(), only custom ones set through Player.Character.
For anyone else facing this problem, here’s an inefficient way of getting your onJumpRequest functions to work:
(Must be in a local script)
local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")
local plr = Players.LocalPlayer
local plrChar:Model = plr.Character or plr.CharacterAdded:Wait()
local PlrGui = plr:WaitForChild("PlayerGui")
local TouchGui:ScreenGui = nil
local TouchControlFrame:Frame = nil
local JumpButton:ImageButton = nil
local JumpButtonConnection:RBXScriptConnection = nil
local function onJumpRequest()
-- Do jumping logic here
end
local function DetectMobileControls(NewChildInstance)
if NewChildInstance:IsA("ScreenGui") and NewChildInstance.Name == "TouchGui" then
local hopefullyTouchControlFrame = NewChildInstance:FindFirstChild("TouchControlFrame")
if hopefullyTouchControlFrame ~= nil and hopefullyTouchControlFrame:IsA("Frame") then
local hopefullyJumpButton = hopefullyTouchControlFrame:FindFirstChild("JumpButton")
if hopefullyJumpButton ~= nil and hopefullyJumpButton:IsA("ImageButton") then
TouchGui = NewChildInstance
TouchControlFrame = hopefullyTouchControlFrame
JumpButton = hopefullyJumpButton
if JumpButtonConnection ~= nil then
JumpButtonConnection:Disconnect()
end
JumpButtonConnection = JumpButton.MouseButton1Down:Connect(onJumpRequest)
end
end
end
end
PlrGui.ChildAdded:Connect(DetectMobileControls)
UIS.InputBegan:Connect(function(InputObject, gameProcessedEvent)
if (InputObject.KeyCode == Enum.KeyCode.Space or InputObject.KeyCode == Enum.KeyCode.ButtonA) then
onJumpRequest()
end
end)
for _, child in PlrGui:GetChildren() do
DetectMobileControls(child)
end
--This doesn't work with our new Custom Character System
---game:GetService("UserInputService").JumpRequest:Connect(onJumpRequest)
I just spent like hours trying to figure out why my double jump script wasn’t working after I changed my character with my morph script. I asked ChatGPT many times to fix it, and I even went to Claude and asked it what was wrong, none of them could tell me anything. After adding print statements I figured out that JumpRequest stops firing after changing my character. That’s when I came to the DevForum and found this script that is a life saver, thank you so much for making it.