I have a layer, which should be draggable over a circular path, like this. Im looking for what draggable constraints need to be set to achieve this. Does anyone know of examples that I can reference?Thanks in advance.
you could get the difference between the starting x position and current position on drag in which ever axis you care about mapping to then you just have to use that value to set the rotation on a parent layout. all the nested children will be rotated relative to its center of rotation.
Not sure if theres an easier way but thats one way
I was trying to write you some code to do it with trig but I cant figure out how to get to the math library (i.e. cos/ sin functions) ... I should probably google that
Edit: oh wait i was just being an idiot
Brian Williams - http://framer.link/share.framerjs.com/download/fb47veij7eh1/project.zip - I think this is what I am looking for :)
i wrote a module for that, hope u will find it usefull)
I still think that there are two valid approaches here.
Sergeys method is what I would use if you need to do cross layer transforms ...
(I might update Sergeys function to take a collection/ args... so that you dont have to write multiple method calls :) to do the exact same thing on multiple layers in that case)
Although if its all in the same grouped layer/ object anyway I would do it this way.