Problem with touchscreen moving camera when interacting with widget slider

Hello,

I am having a problem when i try to use the slider on touchscreen to change the intensity of light it moves my camera when i move the slider, as if the slider doesn’t have any collison i guess.

It works perfectly on PC, i move the slider, the light intensity is changing, but when i try the same on touchscreen, the touch input kind of goes through the widget and it starts moving my camera together with slider…

Any ideas if the problem is inside the BP or Widget?

Best,

When creating the widget, try to set to ui mode only:
image

I did, but that locks my screen, it shouldn’t be locked.

It should act as if i opened an inventory in DIablo for example.

You can move around but you can click on items in your inventory and your action won’t go through the Inventory.

But i still can’t find the solution.

Hi! I came across this thread and I was wondering if you were able to solve the issue. I’m currently facing the exact same problem with the touchscreen moving the camera while interacting with a widget slider.

If you found a solution or any kind of workaround, I’d really appreciate it if you could share it. Thanks in advance!

I didn’t but i run into something similar, usually the vertical box or border or something like that should have their visibility set to Not hit testable (Self only) or to visible and that will block input from going through.

But i didn’t solve it on the slider problem yet.

Have you had any luck?

I also encountered this problem.
After debugging and testing, I have identified the root cause.

When we press above the UI, it usually does not trigger the event after Pressed for touch input. The events after Moved and Released naturally cannot be triggered.

A special case: When this UI is a Slider, pressing does not trigger Pressed, but dragging briefly triggers a few frames of Moved event!

Due to my camera’s interaction, Pressd is triggered when pressed, storing a mouse position in a variable, Moved is triggered when dragged, and the difference between the latest mouse position and the recorded mouse position is added to the camera’s rotation. Then update the recorded mouse position with the latest mouse position, and use this loop to drive the camera rotation.

Therefore, when interacting with the slider, the event after Pressed is not triggered and the latest mouse position is not recorded, while dragging triggers the event after Moved. At this time, the latest mouse position and the position at the end of the last drag will be subtracted and added to the rotation of my camera. Causing a brief camera rotation when I drag the slider

This may be an issue with the source code of the Slider component. I am not a programmer and do not understand how to read the source code. If it is a bug, I hope the official can fix it as soon as possible.

My current solution is to enable a Tick event before using the slider, and keep updating the mouse position recorded in the Pressed event. When dragging the slider triggers a brief Moved exception, the camera will hardly rotate because the latest mouse position is equal to or very close to the one I recorded. Of course, this method may bring some performance issues. Let’s use it temporarily before considering optimization solutions.

You can also solve this problem based on the actual situation of your camera interaction, hoping to help you.

——————————————————————————————————————————————

Update:
The temporary use of the Tick event method mentioned above can only be done in the editor. It is effective when the project settings are checked to simulate touch with a mouse, and it is useless after packaging (because touch screens do not have movement trajectories like mice).

The good news is that I found a better way today (cleverly utilizing the BUG feature of the slider component):
Just add a Boolean variable. I named it ‘A’ and set it to true by default.
Add a branch judgment after the Moved event. If A is true, no action will be taken. If A is false, the original event (such as moving or rotating the camera) will be triggered normally.
After the Pressed event, set A to false.
After the Released event, set A to true.

Okay, now let’s sort out the logic:
Firstly, there is a situation where operations are not performed on the UI. Pressing it will trigger the Pressed event, setting A to false, so when moving, it can trigger camera rotation and movement normally. When the touch is released, A is set to true again.
Then there is the situation of operating on the slider. According to previous tests, it is known that when the touch is pressed on the slider, the Pressed event after input Touch will not be triggered. Therefore, the Boolean variable A will remain at its default value (true). Dragging the slider at this time will briefly trigger the Moved event. Since the value of A is true, no subsequent movement or rotation of the camera will be performed, but the slider can be dragged normally. Leaving touch will not trigger the Released event, but A will still remain true.
Afterwards, I tested it on the packaged Android device and it was also normal. I think this should be a solution before the official fix of this issue. (The engine version I am using is 5.6.1)