# Drag with snap!

**URL:** <https://forum.kirupa.com/t/drag-with-snap/84799>\
**Category:** Uncategorized\
**Created:** [March 30, 2005, 4:13pm UTC](https://forum.kirupa.com/t/drag-with-snap/84799 "2005-03-30T16:13:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![matd](https://avatars.discourse-cdn.com/v4/letter/m/b38774/32.png) [@matd](https://forum.kirupa.com/u/matd)\
**Post date:** [March 30, 2005, 4:13pm UTC](https://forum.kirupa.com/t/drag-with-snap/84799/1 "2005-03-30T16:13:58Z")

</div>

I’m making a slider - the scrub button can be smoothly dragged anywhere along a bar marked with increments, but once the button is released, I want it to snap to the nearest increment.  
Would I have an array variable containing the positions of the increments, and then examine that to see which is the nearest position, or is there a better way?
