I need help with a rotation expression
I am new to expressions and am trying to rotate multiple shape layers. So far I keyframed the top layer to rotate around the z axis 360 degrees. There is a slider on the first layer that controls the time offset and an index/value at time expression on the layer below. The problem is that every layer rotates 360 degrees and I want each layer below when duplicated to rotate 22.5 degrees less and all ease in and out. The expression I used is:
timeoffset = thisComp.layer("top card").effect("Slider Control")("Slider");
thisComp.layer("top card").transform.rotation.valueAtTime(time - ((index - 1) * timeoffset))
layer 1 360
layer 2 337.5
layer 3 315 etc.
I would appreciate some suggestions. Thank you.



When the animation is done it should look close to below

I don't want it to continue on like below





