Godot Version
4.3 stable mono
Question
I’m doing a click-and-drag UI. I’ve got the right input handlers to track when I’m click/dragging a node, and _process logic to position it to the mouse global position. That works.
The issue I’m having is that in the game, you can click and select multiple nodes (dice), and drag them as a single group.
I can’t quite figure out the best way to do this. I can’t position them all to the mouse global position, since then they’ll just all clump on top of each other.
I thought maybe I could use the angle_to and distance_to between the die’s current position, and the mouse’s current position, and move all the nodes along that angle for that distance.
If so, how could I do that? I can’t quite wrap my head around the needed vector math.
Or am I overcomplicating this and there’s a better way?