0 votes

I'm making a drag and drop game, but when the object enters the destination position, it is still movable if I don't release the mouse click. Is there a way do "unclick" the object?

in Engine by (14 points)

Could you provide a code snippet of what you have so far? And what do you mean by "if I don't release the mouse click"? Is the object supposed to exit draggable state once it moves into the designated area?

1 Answer

0 votes

Are you looking for Input.is_action_just_released( "click" )

var clicked = false

if input.is_action_just_released( "click" ):
    clicked = !clicked

if clicked:
    "button pressed"
else:
    "button unpressed"
by (335 points)
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 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 webmaster@godotengine.org with your username.