When the player jumps and if directly after GuiService.TouchControlsEnabled is set to false, the JumpButton becomes unresponsive and remains stuck in “Automatic Jump” mode. The JumpButton can only be interacted with after touching a CoreGui button, such as the ChatButton.
This issue occurs both in Studio (Windows) and on a Mobile Device (Android). (Latest Version Available)
This issue might exist, as GuiService.TouchControlsEnabled got implemented.
Repro
Create a LocalScript in game.StarterPlayer.StarterCharacterScripts
Paste the Code below, for one bug replication per Test Session
Now Test it in a Mobile Environment, by touching the JumpButton.
local Gui_Service = game:GetService("GuiService")
local Humanoid = script.Parent:WaitForChild("Humanoid")
local Connection
Connection = Humanoid.Jumping:Connect(function()
Connection:Disconnect() -- Disconnecting, or else fired nonstop
print("Disable Touch Control")
Gui_Service.TouchControlsEnabled = false
task.wait(1)
Gui_Service.TouchControlsEnabled = true
print("Enable Touch Control")
end)
Expected Behavior:
After jumping, the JumpButton should remain responsive and not get stuck in “Automatic Jump” mode when GuiService.TouchControlsEnabled is set to false.
I’ve witnessed this happen in 2 different contexts in my game.
1: When a round ends, but the player is jumping while it ends (e.g. spamming the jumpbutton)
→ The jump button is also frozen, because the character is cleaned up while the jump button is in it’s “active state” (Plr.Character = nil and Old_Char:Destroy())
→ On respawn the jump button is stuck until you tap the Menubutton on the top left
=> This can cause players to be upset, a manual solution would be to block jumping before the character gets destroyed
2: When the player is touching a part, which makes a UI popup (+ disabled TouchControls), but the player triggered the .Touched Event by jumping into it / while being in the part
The behavior of this problem, looks exactly like the behavior, which can be replicated via my Repro Script.
Possible Summary:
If a JumpButton is disabled while in it’s active state → Bricked/ Frozen until you interact with a CoreGui
I’ve looked a bit into this issue, and I was able to replicate this behavior.
It seems like that the following line in the TouchJump ControlModule is not firing, if the JumpButton gets disabled:
self.jumpButton.InputEnded:connect(function(inputObject: InputObject)
if inputObject == touchObject then
OnInputEnded()
end
end)
Which will cause it to be frozen and InputObject will never be nil in the following code:
self.jumpButton.InputBegan:connect(function(inputObject)
--A touch that starts elsewhere on the screen will be sent to a frame's InputBegan event
--if it moves over the frame. So we check that this is actually a new touch (inputObject.UserInputState ~= Enum.UserInputState.Begin)
print(touchObject)
if touchObject or inputObject.UserInputType ~= Enum.UserInputType.Touch
or inputObject.UserInputState ~= Enum.UserInputState.Begin then
return
end
touchObject = inputObject
self.jumpButton.ImageRectOffset = Vector2.new(146, 146)
self.isJumping = true
end)
When the Character of the player is set to nil and then destroyed, then the TouchGui will also be .Enabled = false, which the script will also not be able to detect
→ another case where .InputEnded could fail (it seems to not freeze this time however)
The solution is probably to add a listener which does OnInputEnded if the TouchGui is turned to Enabled = false
PROBLEM IDENTIFIED: TouchGui.Enabled = false ( → .InputEnded not fired → touchObject ~= nil → .InputBegan never fully running (Previously: ONLY FIX pressing roblox button top left → .MenuOpened fired → wiped touchobject)
OCCURANCE (Requirement: OnInputEnded() not fired yet e.g. holding jump button/ started to jump (e. g. 200 ms hold) + TouchGui.Enabled = false):
Manual Character respawn system: Player.Character = nil
GuiService.TouchControlsEnabled = false
MY SOLUTION (See attached files):
(Potentially Redundant if Solution 2 is applied):
(Adding Callback for OnInputEnded on CharacterAdded)
function TouchJump:SetupCharacterAddedFunction(ReleaseButton_Callback)
self.characterAddedConn = Players.LocalPlayer.CharacterAdded:Connect(function(char)
ReleaseButton_Callback() -- Guarantee wiping variable "touchobject"
self:CharacterAdded(char)
end)
if Players.LocalPlayer.Character then
self:CharacterAdded(Players.LocalPlayer.Character)
end
end
if not self.characterAddedConn then
self:SetupCharacterAddedFunction(OnInputEnded)
end
-- Prevent Edge Case: .InputEnded never fired when TouchGui is disabled | SIDE NOTE: This might make "ReleaseButton_Callback" redundant
if self.parentUIFrame.Parent and self.parentUIFrame.Parent:IsA("ScreenGui") then -- Might be redundant, I don't want to tolerate any potential edge cases
self.parentUIFrame.Parent:GetPropertyChangedSignal("Enabled"):Connect(function()
OnInputEnded()
end)
else
warn("PARENTUIFRAME.PARENT NOT FOUND") -- If this is tracked -> Edge Case found -> Reset Callback has a use case
end
Yep, so far it looks like no one has looked into the issue.
I’ve also implemented the solutions into the jumpbutton code (by copy pasting aka. forking the control modules), and I haven’t seen a complain since. (in my game)
Thanks alot!
The solutions + attached files for the Roblox PlayerModule.TouchJump I’ve provided above, could help with speeding up the process. (They seem to work, as I haven’t gotten any complaint about frozen JumpButton since implementing them)
Hello, The issue may occur if you press the jump button too hard. To bypass this issue, you can press the menu button on the top left which represents the Roblox logo, as it will prevent pressing the jump button. It may also be due to sweat on your finger on the screen. It is not necessarily caused by scripts. Have a good day.
Thanks for the report! I’ve taken a look and the issue should be fixed now. Toggling the mobile UI while jumping should no longer lock you in a jumping state.
Hello, it’s great that if you have a problem you were able to solve it, but it can also happen with the finger getting stuck on the screen. I know that you are probably aware that the problem still occurs, but for sweating, it cannot be corrected.
The best solution to solve the problem is to press the menu because it blocks the jump button, but I see many new Roblox players jumping for hours or quitting. They don’t have the idea of pressing in the top left corner. Is there a feature that Roblox could implement so that they can figure out how to do it?
Hello, I’ve now tried to use the newly updated roblox modules, after having it forked since January.
The issue still persists, and I’ve seen & appreciated the effort you’ve made to try to fix it.
The community has told me that it happens across all games that have a certain type of Teleport mechanic e.g. Rivals, certain Obbies
The provided Edge Case with “TouchControlsEnabled” has been fixed, but not the one where Player.Character is set nil while jumping. Here is a repro file of the issue: Touchjump Frozen Repro.rbxl (53.9 KB)
My initial RBXM file should give you ideas on how it could be easily fixed. Here is a repro video:
I believe this has a bigger impact on mobile players, as lots of mobile players I’ve talked to from my community has experienced this issue in other games. (removed character while jumping e.g. game started or game ended)