How does the drag interaction on Photo carousel work?

Hello,
I’ve played with the Playground file and got to the Photo Carousel. I don’t understand how it works. The interaction is just set to “On drag”. It doesn’t say “On drag left” or “On drag right”. How does Figma know which way the drag should be applied? I guess I’m missing something but right now it seems like magic to me :slight_smile:

The direction is based on where the object is moved to in the next screen. It can even be connected to two screens at the same time with different directions.

See example from this post: Need swipe gesture - #8 by Gleb

1 Like

Thank you. Is there any documentation on this?

1 Like

Hi Gleb!

Thanks for all of your contributions, they have helped me a lot learning Figma. I am trying to do a simple on drag carousel but for whatever reason, the middle slide 2 gets confused which direction to go and doesn’t in your typical drag left and right manner, I am not sure what I am doing wrong. I also want to make it so the arrows do not slide with each slide and remain static on top of the slides. I made it a separate component and thought maybe smart animate would not animate them if they are matching names but they still move with the slide.

Your slides are overlapping each other:

1 Like

Thanks - dumb error! But it’s still not working … would you mind taking another look? I just tried again. This time tried to make an infinity slider and it works but only going one direction still. I even went off one of your examples I found in a previous thread but for some reason can’t figure out what I am missing (it is driving me crazy). Behaves as I want swiping left. Thank you so much!!