+1 vote

For example:

func _unhandled_input( event ):
    if( event.index == 0 ):
        if( event.type == InputEvent.SCREEN_TOUCH ):
            if( event.pressed ):
                # DO STUFF
                return true
        elif( event.type == InputEvent.SCREEN_DRAG ): )
                # DO STUFF
                return true

    # If it got here, no event got processed, pass it on ??

Or does Godot "knows" when an event gets processed automatically? Am I on the right track?

in Engine by (16 points)

1 Answer

+4 votes
Best answer

Call get_tree().set_input_as_handled() to stop it from propagating.

More info here: http://docs.godotengine.org/en/3.0/tutorials/inputs/inputevent.html?highlight=set_input_as_handled

by (2,176 points)
selected by
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.