Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | VincePrinceKing | |
Old Version | Published before Godot 3 was released. |
I noticed i _input(event) stops working after i go under a viewport node in the scene tree.
I switched Disable_Input in the viewports inspector on and off.
Tested the following script and as it is above the viewport it works just fine, as soon is in the viewports script or in a child of the viewports it stops working.
What exactly is the reason for this behaviour? and can i somehow work arround that? my Player.scn is a child to the viewport and i would prefer if a can handle all input for its movement inside of its own script.
func _ready():
set_process_input(true)
func _input(event):
if (event.type == InputEvent.MOUSE_BUTTON):
print("_inputMOUSE")
if Input.is_action_pressed("ui_up"):
print("_inputUP")
if event.is_action_pressed("ui_down"):
print("_inputDOWN")