Help with Sticking Objects

Godot version 4

Hey there! So I’m fairly new to Godot but I’ve been having a problem. I have been working on a project involving music notes and a staff. I want to be able to drag a card that has a music note to the staff, and when the left mouse button is released, it turns into a note on the correct line or space. I had another person try to help me with this issue but we both came up stumped as to how to most efficiently tackle this problem. Any advice?

If the notes are aligned to a grid then you can just use the snapped function on a Vector2 to move the note to the nearest position.