Can Snapped Objects Ease Into their Socket Instead of Jumping?

Instead of the object “jumping” into position, I want the object to float smoothly into the correct position, rotation, etc. in the socket.

I don’t see a setting for this in the Socket Interactor, maybe there’s a script that could do it?

Thanks for any help!

Using an override method in a separate script that inherits from the XR Socket Interactor would work. It may also be possible to just create your own socket script that set a lerp transform position of object to the socket.

1 Like

@MrSuter You will find the lerping script in UpdateTarget from XRGrabInteractable. You can copy paste the entire XRGrabInteractable script into new script. Then change the UpdateTarget as per your expectations.

Were you all able to find a stable solution? I’m exploring this on the following link but I have an issue with the transform being slightly off on the position: Error on Lerping Object Back to Start Position After Force Grab - Unity Engine - Unity Discussions

It seems to reach the right position, but then get a slight offset.

I posted a code sample there too in case it helps anyone exploring this. A notable difference though is that I’m not using this with a socket. I’m just trying to return an object to the state of an initial transform.