+1 vote

When the player (KinematicBody2D) enters an Area2D node I attempt to disable all input via

get_tree().get_root().set_disable_input(true)

from within a singleton script. However, this produces a bizarre and unexpected result:

most input is disabled (sword attack, jumping, firing projectile, etc) however if the player entered from the left then moving the analog stick to the right still moves the player right and moving the analog stick to the left now moves the player to the right! If instead the player entered from the right then the reverse occurs (analog left moves player left but analog right moves player left, and all other input is disabled).

My guess is that the state of the analog stick at the time that set_disable_input is called can affect the outcome of the function.

Is this an intentional outcome, or some kind of bug? There isn't much in the documentation about the function ...

Godot version v3.2.3.stable.official
in Engine by (63 points)
edited by

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 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.