Hi. I’ve just begun to learn Hype and in this test scene (attached) I’d like the blue ellipse to oscillate vertically in sync with the ‘top’ position of the pink ellipse as it animates in a circle.
I’ve set up a function to do this but it clearly needs something more than what I’ve placed there so far. i.e. some sort of ability to continuously evaluate the ‘top’ position of the pink ellipse and apply this to the ‘top’ position of the blue ellipse. (my apologies for the likely simplicity of what I’m asking - appreciate your understanding) position tracking test.hype.zip (12.7 KB)
Is there a reason why You did not use the timeline that You have already set up for the “Orbiting” (pink) ellipse - for the oscillating blue ellipse? Attached is a demo project…
Thank you Jim. This is simpler and I have recently been gaining experience with making timeline animations. I do have a more complex animation in production that has multiple timeline animations but I was noticing some ‘drift’ over time. This is probably due to some of the customised easing in and out curves I have produced introducing small variations.
So - I was thinking that I could try to lock-down some of the timing by linking the motion of one object to that of another via javascript. I don’t have production experience in knowing how this will pan out …so will see what happens.
"Linear" might be a better option under certain circumstances... especially in a repeat loop on the same timeline. If both elements are running the same easing set-up I would think the outcome (positioning, etc.) would be the same.
In any event Hype is a great toolbox - and, as in this post - there are often different approaches that achieve the same result.
You can even pass arguments to the aliased hype function from thecustom Math Equation so you can run more that one set of elements from the same aliased hype function.
@h_classen is talking about the window scope your using to intermediate between the Hype Document and the the easing function. Usually not a problem but one tries to avoid it in a general solution. But whatever does the job specially for single cases.
Oh that global. There probably is I think I did it that way originally at the time because I did not find one when I was just trying to get it done quickly in a simple way.
True! and then (for more documents) one would have to make sure that the object keys array is sorted the same way just to be sure that index 0 is the same across browser. Not sure how reliable native object keys sorting is but the main problem with that approach is that naming of documents can change or if another document is named with Z or A it would either be appended or inserted at the brining of the list. So it is again page specific and not general.
Directly hardcoding the name of the document instead of the object keys would also be a solution just it would need to catch the case that Hype uses „index“ in previews rather then the export name. Not making live easy for us
Wow! Thank you so much @MarkHunte for taking the time and energy to do this. It’s fascinating and very helpful! I’m not experienced in this area enough to be able to understand deeply how it all works but at the surface level can see how the relationships between these three blocks of code are established. I’ll experiment with it further. Regards