UserInputService.TouchPan gameProcessedEvent Always False

Issue

When a player scrolls on a ScrollingFrame, the UserInputService.TouchPan gameProcessedEvent returns false, even though it should return true in this and many other cases.

This issue causes problems when scripting systems like a custom camera for a build mode, as it makes the camera move unintentionally while the user is just trying to scroll through the build mode UI to select an item to place.

System Information

This issue happens on the Roblox Studio Emulator, but also on my S24 Ultra (and probably on other touch devices).

Impacted Game

My game, My Prison, is impacted by this issue in the “Build Mode Camera”.

I’m even getting negative feedback due to this issue:
image

Demo

Demo Context

In the video, I’ll compare the gameProcessedEvent value on TouchPan and TouchTap with this code:

  • For TouchTap (I’m not using this event in My Prison, I added this print to compare the gameProcessedEvent behavior between TouchTap and TouchPan):

    UserInputService.TouchTap:Connect(function(touchPositions, gameProcessedEvent)
    			print("TouchTap: gameProcessedEvent = ", gameProcessedEvent)
    		end)
    
  • For TouchPan (the function used to move the build mode camera in My Prison):

    UserInputService.TouchPan:Connect(
    			function(touchPositions, totalTranslation, velocity, state, gameProcessedEvent)
    				print("TouchPan: gameProcessedEvent = ", gameProcessedEvent)
    				if state == Enum.UserInputState.Begin then
    					lastTouchTranslation = Vector2.new()
    				end
    				--Check if the camera is not locked and if not gameProcessed
    				if not gameProcessedEvent and not BuildCamera.Locked then
    					--Check if is a change and if touch pan ended
    					if state == Enum.UserInputState.Change then --or state == Enum.UserInputState.End then
    						local difference = totalTranslation - lastTouchTranslation --Determinate the difference
    						--Store the move in a Vector3 and add the good speed
    						local move = -Vector3.new(difference.X, 0, difference.Y) * MOBILE_MOVE_SPEED
    
    						--Apply the camera move
    						ApplyNextMove(move)
    					end
    				end
    				--Update the lastTouchTranslation
    				lastTouchTranslation = totalTranslation
    			end
    		)
    

Of course, the build mode scrolling frame is set to ScrollingFrame.Active = true.

Demo Videos

  • Build Mode Scrolling Frame: When I scroll on the canvas, the TouchPan gameProcessedEvent is false, but when I tap on the canvas, the TouchTap gameProcessedEvent is true.
  • Clicking on Buttons: When I pan on the buttons, the TouchPan gameProcessedEvent is false, but when I tap on the buttons, the TouchTap gameProcessedEvent is true.
  • Roblox Chat: When I scroll on the chat canvas, the TouchPan gameProcessedEvent is false, but when I tap on the chat canvas, the TouchTap gameProcessedEvent is true.
  • Roblox Menu: The only time I noticed the TouchPan gameProcessedEvent returning true is when scrolling in the Roblox menu.

Similar issue in the past

This issue is similar to a previous one regarding the TouchTap event (which is now resolved, but it might help fix the TouchPan issue): UserInputService.TouchTap gameProcessedEvent Always False

Expected behavior

When TouchPan happend in a UI handled by the engine like Button Press or Canva Scroll, I expect gameProcessedEvent to be false.

Hi Florianne, thanks for reporting this.

Is your issue solved by adding a gesture listener to the scroll view or any other GuiObject within that Gui?

The active property and sinking behavior has always had a lot of complicated nuance and lack of fine grain control. The change last year that caused this essentially gives you a lever to ask for gestures when you want them and get upwards of 15% more fps on mobile devices when you don’t need them. We will be updating the documentation and we are working on some new API options to more directly control and manage this sort of behavior as we build out a new alternative to the active property. Our hope is to untie some of these things that are glued together right now so that we can deliver more performance improvements and make gui and input development on the platform a lot more straightforward.

1 Like

Thank you so much! Adding a TouchPan connection to the main build mode Frame fixed the issue. The gameProcessedEvent parameter for my UserInputService.TouchPan event now correctly returns true when scrolling in build mode.

1 Like

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