I want to stop OnMouseDrag() halfway

Sorry it is a machine translation.

After I started dragging with OnMouseDrag(), I want to do a process to forcibly release drag when moving a fixed distance.
Organizing the order

  1. Start dragging with OnMouseDrag
  2. Drag a fixed distance
  3. Drag is released, and what you were dragging drops there
    (Keep mouse clicks)
    I do not know how to do this part 3.

I am sorry for the initial question, but someone please teach me.

You can do this with some globally defined var. Place an if clause in the OnMouseDrag() function that checks if the required distance has been achieved. If so, don’t drag. Else, keep dragging. You will manage this global variable in the parts of the code that calculate dragged distance.