What I want to do is somewhat complicated, but I'll try to explain it to the best of my ability. I am using Unity's EventSystems events to detect a drag. When the user drags the object horizontally, I want to play the animation relative to the position of the object.
For example: If the user drags object to position 0.5, I want the animation to only play to time 0.5, and if the user drags back to 0.2, I want the animation to play back to time 0.2
Currently, I do not have any code because I do not know where to begin.