It does have drag-and-drop functionality.
Take a look at the Drag & Drop GUI demo project.
I’ll take a look.
I am looking to have an object only move towards the mouse if the left button in held down. Would that be something different that drag and drop?
ondesic | 2017-04-08 06:29
Yes it is.
You will want to take the subtract the object position from the mouse position to get a vector. Normalize it, multiply in the speed, and then add it the existing object position. And repeat this every frame.
Something like:
var heading = (mouse_pos - object_pos).normalized()
var new_pos = object_pos + heading * speed * delta
object.set_pos(new_pos)
avencherus | 2017-04-08 10:01
I’m affraid it’s more complex than that: mouse coordinates are given in the screen space and in your case you are interested by the global coordinates in your game ! Except if your camera is static and your screen coordinates ARE your world’ coordinates… Otherwise I guess you should use Viewport and canvas transforms — Godot Engine (stable) documentation in English