Hello!
I'm using the DragRigidBody PlayMaker action for a bunch of mouse drag interactions in my current project but I'm having trouble thinking of a way to limit how far the player can drag certain objects from there original position.
I've tried using joints to limit the distance but found that they interfere with the rigid body when released since I'm controlling its position in that state. This also causes visual hitches since the rigid body is animating at the same time the joint is pulling it back.
What I would like to achieve is something similar to the Unity Scroll Rect which sets a soft/elastic limit on how far it can be scrolled. With that idea in mind, I tried getting the distance of my rigid body and increasing the spring value as it got further away to slow it down. This seems to have some effect but with a couple drawbacks: First of all, the object becomes immobile at its limit where it should be able to freely move around within the limits. Secondly, I'm stumped on how to go about detecting if the player begins dragging back towards the origin. In this situation, the spring should go back to normal rather than slowly decrease along with the distance. It's feeling more like the object gets stuck in molasses rather than is tied to a soft limit.
If anyone has a suggestion on how I can calculate this kind of thing, it would be greatly appreciated