Can Canvaslayer nodes not read input anymore (Godot 4)?

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

I have a pretty long script for my game’s WorldUI which is attached to a Canvaslayer node. In Godot 3.X, I controlled UI-based inputs with this script. For instance, if I’m in the main overworld and WorldUI is in the scene tree, I would be able to hit my pause key (‘=’) and the pause menu would come up. I could hit the inventory key (‘I’) and the inventory menu would come up. I could hit the check key (‘c’) and the player would check for something/talk to NPCs directly in front of him. These inputs were all managed in the WorldUI code within sub-functions that process() calls (a state machine enum, to be exact). I could even run the WorldUI scene by itself, hit those keys, and it would work perfectly.

I’ve converted to Godot 4.0.3.stable, worked a long time to get the code back in what I would think would be a working state, however, the inputs are not being recognized. I’ve tried deleting the entries on the Project Settings InputMap and re-adding them. I’ve tried putting print() lines at different spots across the code to just see if it can even tell I’m making inputs and it is very apparent that the script is not seeing my inputs. Nothing comes up in the output no matter what. I’ve tried putting print() lines in my Global script and that is recognizing, so I know the game can see it, it’s just this code/scene that isn’t.

Does Godot 4 not allow inputs in CanvasLayer node-based scripts for some reason or what is going on here?

Relevant code:

extends CanvasLayer

var state = UNPAUSED

enum { 
	UNPAUSED,
	PAUSEBAR,
	INVENTORY,
	PARTY,
	OPTIONS,
	DIALOG,
	CUTSCENE
}

func _process(delta):
	match state:
		UNPAUSED:                                                      
			unpaused_state(delta)
		PAUSEBAR:
			pausebar_state(delta)
		INVENTORY:
			inventory_state(delta)
		PARTY:
			party_state(delta)
		OPTIONS:
			options_state(delta)
		DIALOG:
			dialog_state(delta)
		CUTSCENE:
			cutscene_state(delta)
	
	
	if Input.is_action_just_pressed("pause"):
		print("UIprocess_pause_pressed")
	if Input.is_action_just_pressed("inventory"):
		print("UIprocess_inventory_pressed")
	if Input.is_action_just_pressed("party"):
		print("UIprocess_party_pressed")
	if Input.is_action_just_pressed("options"):
		print("UIprocess_options_pressed")
	if Input.is_action_just_pressed("check"):
		print("UIprocess_check_pressed")

I’ve tried the print() lines in other functions lower down as well but if it can’t even see my input from here there’s definitely something going on.

:bust_in_silhouette: Reply From: PIZZA_ALERT

I have determined that my CanvasLayer scene was simply bugged. I cannot figure out what the issue was and it will remain unexplained besides the assumption that something in the scene got corrupted in the conversion to 4.X. After this post I basically manually duplicated the scene with new node names and the inputs are now working.

Now if only my tweens would stop breaking…