set_disable_input seems to not be working

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Godont

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 …