The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

+1 vote

I am implementing an inventory system, and I have different control nodes that use gui input signal to a parent node script to handle those inputs. I noticed that when you press the mouse on the child nodes, the gui input signal continues to be fired from the same control you originally clicked on up until you release the button. I would have thought the input would propagate across the nodes, but printing out every input event when gui_input is fired, the same control node fires the signal until you let go of the button.

I am trying to implement a drag-n-drop style inventory, and when I click on an item, I can latch it to the mouse, but the same control will continue firing input signals until I release the mouse button, so I can't release my item over a different control node to re-assign the item's location.

I would have thought that each action's pressed / released mode would be handled independently, so how do I go about fixing this?

in Engine by (22 points)

I tried changing it to utilize mouseentered / mouseexited on the control nodes and leaving boolean values for this in the parent script, and using the parent's input(ev) function to do a similar thing - but it still has the same problem - if I start clicking when on one control, mouseexited does not signal and mouseentered does not signal on the new control as long as the mouse button is pressed.

This user apparently has the exact same problem and I saw no solution there. Been searching these questions forums for a while and haven't found a solution or where I'm mislead in my thinking.

https://godotengine.org/qa/25062/input-from-mouse-blocks-mouse-entered-exited-signal-functions?show=25062#q25062

If anyone checks this out, I just found the drag and drop demo in the demo projects and it seems I am mislead in how to approach this problem, as the demo shows you can utilize the built in functions for controls to approach this problem. Seeing if it solves my issues.

If anyone else has a problem getting getdragdata to work with candropdata, make sure the control you want to drop on has the mouse filter set to Stop, as Pass will not allow you to drag and drop to that control.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.