- Home /
StandaloneInputModule allowActivationOnMobileDevice vs forceModuleActive
So I'm having an issue with StandaloneInputModule on mobile devices, by acting like a mouse pointer is hovering at the point I last released a touch. Especially coupled with an inertia-enabled scroll view, the results are... weird.
Anyway, I discovered that the problem is easily remedied by disabling my StandaloneInputModule. Unfortunately, this means I have to remember to disable it every time I build, or enable it every time I run in the editor.
Then I saw there was a property - allowActivationOnMobileDevice - which should address this. But now it's deprecated, and can't be turned on or off in the editor.
And here's the issue - the docs claim that forceModuleActive is a replacement, but even with that unchecked, the module is being activated on mobile, causing the described issue.
I guess I could use a conditional #if UNITY_EDITOR or something to do it at runtime myself, but I'm curious why it seems like functionality was removed. Does anyone else know a good solution? Thanks
Edit: While experimenting, I tried setting force module active on the touch input module... this completely breaks my UI, as it seems to deselect objects I click on before clicking them, which doesn't play nice with another script I have that makes sure something is always selected (necessary for controller/directional-based input).
So, just to recap: (SIM and TIM are Standalone and Touch input modules, respectively)
With SIM.enabled=false, I get the flawless functionality I desire, but it breaks my workflow.
With both components enabled, and (SIM.forceActive == TIM.forceActive || SIM.forceActive), I get almost perfect functionality, except the scroll view issue.
With SIM.forceActive = false, TIM.forceActive = true, I get the completely broken UI behavior I mentioned.
What the heck is going on?
Your answer
Follow this Question
Related Questions
Can I Simulate the "Submit" Event with Gamepad Buttons? 0 Answers
IPointerEnterHandler doesn't work when object switches parent 1 Answer
EventSystem events reaching parent EventTrigger? 0 Answers
Input registering random touches 1 Answer
How to get UI elements such as Scroll Rect to work with new input system? 0 Answers