Magnetic drag and drop feature

Hello. I want to consult you about an issue that I can’t find a solution and example for. There are two drag boxes on the screen. This is what I’m trying to do: when I bring these boxes closer together, one box automatically sticks to the other. Do you have an example or a recommendation for this?

createEngine example | Babylon.js Playground (babylonjs.com)

What about this solution?

mesh snapping | Babylon.js Playground (babylonjs.com)

3 Likes

something like this

6 Likes

Simple and efficient. I have to like this one :smile:
Only thing I would likely add something around the speed/inertia of mouse movement. I found, it’s sometimes hard to detach from the follow mesh.

1 Like

too many nice solutions to pick from, the forum only allows one post :slight_smile:

1 Like