Drag and drop for Custom drawn control node

Godot Version

4.3

Question

Hello,

I have a custom drawn hexagonal control node, using _draw function. I want to be able to drag and drop this node, but i cant seem to get the draggable test to fire. I use this function

func _ready():
	add_to_group("DRAGGABLE")

func _get_drag_data(_position):
	print("draggable item")
	return self

Heres my sample scene of the hexagon that i drop into a scene to use.

Anyone know why it isnt draggable? I think its something to do with the inside of the node, I didnt set anything up for it. Tried using a texturerect as child and having the _get_Drag_data function in there but it doesnt work either. If I put the hexagon in a larger container it will work but fires when clicking anywhere in the container

Any help is appreciated! thanks

@prawn.swanson27 I ran into this before and you need to make sure that anything drawn above the node you want to drag has the Mouse Filter setting set to “Ignore” or “Pass” so that Mouse events will pass through it. And then the Node you want to drag needs that set to “Stop.”

I need more information to answer:

  • What’s your DRAGGABLE implement?