"Mouse Object" behaving differently on iPad than Android

I have a draggable inventory in my game “Conquer the World”, I use custom dragging so basically my code runs like this

  • I detect a button1Down, and then set the CurrentButton variable to the button that was clicked
  • I hook mouseButton1Up to my OnButtonRelease function
  • In renderStepped, I move the position of the button to the position of the mouse

The problem is that this works perfectly on both PC and Android mobile devices, but something about apple devices prevents it from functioning correctly. When an apple user releases the touch it doesn’t register as a Button1Up. Can anyone offer some advice or healthy alternatives that wouldn’t involve a complete rewrite of my nifty dragging system?

There might be a way to connect to touch events seamlessly without any getting corrupted. Sometimes I get a touch gesture that doesn’t disconnect if I slide my hand across my phone screen. For now I disconnect all gestures when they reset. (I wish I could detect when they pressed escape/opened the menu so I can do it then)

Edit: For your case it probably has to do with using the button’s ButtonUp event, instead of the UserInputService InputEnded event. The former probably only fires when their gesture is directly above the button, which isn’t always the case while dragging.

Thanks! That was the problem as it turns out. Seems to be fixed. The issue is that since I’m moving the button to the mouse delta on renderstepped, I would assume that buttonUp will fire when the mouse is released, but it’s much better to just have an inputEnded to check that.