I am working in Unity.
I have special objects that can each be dragged freely around in 2d.
The objects cannot get too close to other objects (minimal Vector3.distance allowed is 1.5f).
I also have special connectors, which I can apply freely between 2 of any of these special objects. once 2 objects are connected, dragging them is further restricted.
The 2 objects cannot get too far between each other (max Vector3.distance allowed is 5f).
Both of these restrictions work, my issue is that once these restrictions occur, the objects are pretty much just stuck in place until dragged away from the restriction they tried to pass.
I want the object being dragged to orbit smoothly around the object it's connected to, once they reach any of the 2 restrictions.
The best example I can think of is the angry birds slingshot,
that once it reaches it's maximum pullback, you can just orbit along this max distance smoothly up or down depending on where you are trying to drag, this same smooth effect needs to occur both when too close and too far.
Hope I explained myself thoroughly I tried to find answers and try myself but could not reach any working solution.
The closest I think I got to a solution is with rays and the on point of ray function like in the video I provided below but I have no idea how could that be implemented in my sort of game.
thanks,
Remember the BBQ.
link to the sort of angry birds pulling mechanics I am talking about: https://unity3d.com/learn/tutorials/topics/physics/making-angry-birds-style-game-part-1
Image provided is very inaccurate to the boundaries of each restriction, just to make it seem more clear.