"Amnesia's" trick to grab mechanics?

Godot Version

4.3 with C#

Question

I’m developing a grabbing mechanic and I’d like it to have the property of “restoring original rotation of an object if not colliding with anything” just like here :

I’ve already tried to do it with physics using “apply_torque” method but with little success since the object would just never stop wiggle around.
I also have a hunch that this specific behavior should be possible to design using some kind of joint system.
I already use 6DOF joint to make my objects always face the same direction that they were picked in (relative to player). However I do it by locking any rotational change for the joint. So it does not react when collision happens in grab-mode.
I tried to tweak this 6DOF joint I have, using springs, but I think I need more joints than one to do this.

Do you maybe have any idea of how this could be done ? What I think will help me is general intuition on which joints to use or how generally assemble them to work. The rest do by trial and error.

This looks like you need a spring force (but for torque) to restore the original rotation without oscillation. I would apply a “spring” torque + damping torque which should give some nice results if you create adjustable spring and damping constants.

You can store original transform in meta and use tweener to restore it.

I tried both springs and just angular limits, but both fail to provide behavior I’m looking for.

I suspect that “softness” is an attribute that has not been developed properly in Godot Physics engine.
Here you can see all of them :

Here you have a clip of how this seems to work in Godot :

When I use angular limits I use it with Softness enabled.
When I use springs I make sure they are a little bit overdumped. So for example I use values like : 50 for stiffness and 15 for dumping.

As far as I understand softness of 0 should result in “perfectly stiff” behavior.
Softness of 1 should result in something akin to Amnesia’s behavior during grab.
Springs in 6DOF joint seem not to work at all. I guess it should work within the angular limits?

I’ve written little script also. It technically should implement simple spring behavior but it seems to work poorly as of now. (I’m mentioning this because it’s in a clip.)

additionally : I switched to Jolt physics to test if it will be better, however it seems to glitch through collision shapes when forced by grab.
My grab code simply applies force to the origin point of the grabbed object towards the point in front of the player.
Do you know why it might do that? The big box I collide the grabbed object into is a simple StaticBody3D.

I know it’s a lot so I’ll be glad if you did as much as to point something out if you know what is going on.
Is there a code I can freely look into that has desired grab behavior done for example?
Have you used softness in Godot? Does it work or am I using it wrong?
I’m wondering If I’ll end up writing everything in code myself. I would just prefer not to.