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

What is Framer? Join the Community
Return to index
Charlie Sneath
Posted Feb 04 - Read on Facebook

I'm trying animate the opacity of 3 objects that are hidden in my Sketch file. I have set their visibility = true, and am trying to animate opacity to 1.

There are three layers I would like to animate in sequence:

layers.result0
layers.result1
layers.result2

I am setting the current layer name programmatically, but the layers are not animating correctly. It works if I have the layer unhidden in Sketch when loading the file. Any ideas? Thanks!

showResults = (i) ->
if i < 3
result = layers['result' + i]
result.animate
properties:
opacity: 1
time: .3

Utils.delay .05, ->
showResults(i + 1)

3 Comments

Christian Poschmann

What about making them visible in sketch, then giving the objects two states?layer.states.add
hidden: {opacity:0}
visible: {opacity: 1}

And set the current state to hidden:
layer.states.switchInstant "hidden"

Then you could do
result.states.switch "visible"

Charlie Sneath

That definitely works, but honestly it's just hard to work in Sketch while these layers are visible (they cover other elements).

Preferable to be able to have them hidden, but I can definitely work around it.

Christian Poschmann

yeah, i'm having the same issues. What i usually do is make everything visible in sketch, then import into framer and hide the layers when i continue working in Sketch.

Read the entire post on Facebook