Sounds regulator pressed and released events work but regulator does not move

I have a sounds regulator. I want the user to be able to press the regulator and release it in other place, and I want the regulator to move after cursor but only along the X-axis and clamped to min and max locations that depend on the current DPI scale. Here are the fragments of my blueprint:


2021-10-22_14-09-33
2021-10-22_14-09-50

I tried to set the breakpoints into either Pressed or Released events, and they work! But the regulator does not move. I need help.
P. S. I have already asked this question on AnswerHub, but nobody had answered it at that time, and it is still actual, and now AnswerHub is closed for new questions, so I am now trying to get the answer again here.

Bump. The topic is actual.

Hard to understand what you’re doing. I’d prefer to start from the blank.
Let’s start with the simple logic like you pushing some button and the regulator is moving until the button is pushed.
I haven’t worked with canvas and don’t know exact nodes, first of all, we need to know how exactly it might be moved and only then move to more complicated logic

Also, I’d say that you need to learn how to make your blueprints readable, otherwise even you will forget what does this mess. Try to use reroute nodes and comments for parts of code. Just for example - my code

1 Like

I have done probably in a weird way, where viewport width is being divided by its height, clamped with the minimum 1 and multiplied by constant. Here is screenshot of the full solution. It has been tested on the “standard” (4:3), stretched horizontally and stretched vertically window sizes and even when height is bigger than width, but has not been tested on different computers.