Hey! I just updated one of my project from 4.19.2 to 4.21.2. I’m having issues going around something i think could be a bug, but since i’m no expert i can’t quite confirm it. I’d like your take on it.
Alright, so i started a new project to isolate the issue and make this topic a little simplier.
Steps to share my sorrow:
- create blank project ; in project settings check “use mouse for touch”
- in a playerpawn BP add some PrintString nodes to an InputTouch event so we can keep track of what’s happening (see screenshot)
- in levelmap BP, create a new widget (a simple button, child of a canvas panel) that we then add to viewport (see screenshot)
- in the widget BP, add a “OnClicked” event to our button (prints “Button_OnClicked”), so we can confirm it’s clicked ; while we’re at it, let’s change the “pressed” style to something easier to track, so… pink
Expected behaviour:
A) when i touch the screen (anything but our button), i should see a few prints: 1 “pressed”, a few “moved”, then 1 “released” ; this is what’s happening, sweet
B) then when i touch the button, it should print “Button_OnClicked”, but this is where it gets weird.
The first time i click/touch the button, it prints: 1 “Button_OnClicked”, then, 1 “moved”, then 1 “released”. Again, i just clicked once, no movement.
Also, notice that the button is not pink when clicked as it should since we changed the “pressed” style.
Worse, if i click the button, then move around on the button without releasing, i print a lot of “moved”, then 1 “released”. What i get from this is that the input actually goes through the button.
So is the button ignored? Well no, or we wouldn’t have a “onclicked” print. Also remember it’s a blank project, and the button is “visible”, it should register.
Let’s get weirder. Let’s touch the button a second time.
Yup, now it works as intended, or at least as is worked in 4.19. You can click it as much as you want, it will always print “onclicked” once per click. This time the button is pink as expected. And no moved/released are printed.
If you touch the screen again (anywhere but the button), then you’ll be able to reproduce those steps at will. First touch on the button will be broken, the next ones will work.
It’s like i need to touch the button one time to “focus” on it, then it works. Thing is, firing a “moved” event every time i touch a button breaks everything. Let"s say you use touch to move the camera around, then you click a button, it fires a “moved” event that suddenly move the camera in what i would describe as an incredibly frustrating way. Goddamnit, i just wanted to click a button, not go for a 180 è_é
Anyway, it feels like an important issue to me, or rather my project.
So what’s causing this weird behaviour? Am i stupid and did something terribly wrong? Could this really be a bug? Any workaround?
Well fine people, any idea? I’ll take any help i can. Thank you.