Circular dragging

I am trying to make a knot and I found a .zip on the forum very good. I'd like to know how I can restrict the movement of the knot only between 0 and 359 degrees, only a single full turn. The code currently allows the knot to rotate indefinitely and this is NOT what I want. thanks! (14.8 KB)

This might help:

1 Like

It's a shame!
In this project, the project that you sent, the knot turns without limit and I need to limit it to only one turn both directions...Do you know how can I do it?
Thank you!

you can staore the angle:
hypeDocument.customData.storedAngle = hypeDocument.customData.storedAngle || 0;

check the diff and return or continue:
if(Math.abs(angleDeg - hypeDocument.customData.storedAngle) > 180)return;

hypeDocument.goToTimeInTimelineNamed((angleDeg * duration)/360, 'circle');
hypeDocument.customData.storedAngle = angleDeg
1 Like

Really, really, all of you are really amazing. The kind of support you all are doing is beyond amazing. Since I started with Hype years ago, you all have always been so efficient and attentive.
Thank you for your great work!


Today I've seen a weird behaviour in my beautiful Knot. I believed that with yesterday's advice from you, this would work fine, but something weird and different that previous things are happening.
When I scroll down a little on the page, it's very difficult to drag the knot.
I attached the file.
Please if you can tell me something I'd be grateful!
Thank you! (17.8 KB)

pY = p.getBoundingClientRect().top + window.scrollY;
1 Like

Simply amazing!
Thanks a lot!

Till now, I've implemented all your advice and I'm very happy!
To last, I'm working on my last problem, and there is the following. As you can see in the browser, once you have launched Hype, the moment you move the knot, the sequence of images is different to the moment you go back and try to start again; the sequence it doe not start since the begging! I've been thinking about it till yesterday and I do not how to solve it.
Can you tell me something about please?
Thanks again! (2.2 MB)
Captura de pantalla 2021-11-19 a las 11.53.36 (2.2 MB)

I'd change the stacking order and use opacity.
all in all seems like a mismatch in you timelinesetup ......

though: added a console log for the current time that is shown. so you can see what happens


Wooo, it looks great!

1 Like