Should GameProcessedEvent be true on mobile when walking around?

I’m using the InputBegan function on a Frame to determine input (i.e mouse input or touch input).

However, I’m unsure if my problem is is an engine bug or a misinterpretation of the second parameter for InputBegan, being GameProcessedEvent .

I’m unsure of the actual terminology for this, but on mobile, you use your left thumb stick to drag around and move your character, as so:

https://gyazo.com/79b35a900d7cf2a933279f66677e414f.gif

What I’m unsure of is while dragging the left thumb stick, if my finger enters a frame with an InputBegan event, should GameProcessedEvent be true or false? If it should be true (which it is not currently) then this is an engine bug, but if it’s supposed to be false, then that is the answer to my question.

What I’m thinking is that as the left thumb stick moves your character and is a core game mechanic, it should be considered a game processed event, and therefore should be ignored by InputBegan.

The issue I’m experiencing is that my button is being triggered while dragging the left thumbstick, because GameProcessedEvent is false, despite walking my character around, and not intending to click the button.

https://gyazo.com/0195dffd072f71206db25627641d42b8.gif

I can get around this by referencing the TouchGui instance in my PlayerGui, and reading various properties of the elements inside, to determine whether the user is dragging their left thumbstick or not, but this seems rather hacky.

If anyone could help me get to the bottom of this, that would be great.

2 Likes

GameProcessedEvent is for input that’s listened to internally. Mobile controls are Lua-implemented and handled on the same level as developer scripts, not as CoreScripts. For this reason, GameProcessedEvent does not return true on developer-implemented input.

Everything here you’re experiencing is expected behaviour, which means it’s up to you as the developer to work around these kinds of cases. As for how you do that specifically, I’m not sure.

For starters, one thing you’ll want to do is not handle input in the case of UserInputState.Cancel. Check the UserInputState of the InputObject when you move the thumbstick around and onto a Gui. If it’s Cancel, all you need to do is prevent action when Cancel is passed. If not, this is worth a further look.

3 Likes