This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Wouter Van de Kamp
Posted May 05 - Read on Facebook

Hi all. I'm trying to animate a layer from 90 degrees to 0 degrees. See the image in the attachments. Anyways I wrote the following script but can't seem to get it to work;

It only animates a little bit and after that the layer inside the animate function becomes some weird numbers like 268298.4.

The angle itself goes all the way from 90 to 0 perfectly.

Not sure why this is happening and would love to hear what I'm missing.


JL Flores Mena

I'm not sure if this is the reason why but, It may be an issue with window.requestAnimationFrame()
If you use Utils.interval instead it works (I just tried it).

George Kedenburg III

here's a different way to do this using a proxy layer:

Jonas Treub

Fix: window.requestAnimationFrame(animate.bind(this, layer))

Steve Ruiz

You can also animate the x and y values of a layer in separate layer.animate functions, each with different bezier curves. They'll run at the same time, creating whatever curve you'd like.

Read the entire post on Facebook