How come my "use this item" area isn't detecting anything?

Godot Version

4.1.1

Question

Here’s what I’ve got:
1732176428-83841-image

Player is a CharacterBody2D. I’ve successfully got them moving, colliding with level boundaries and not moving through them. Great.

I want players to be able to “use” certain objects that are in front of them, and probably highlight those objects when they’re within “use” range even before the user presses the use key. I’ve tried to do this with an Area2D (“UseActionArea”) that’s a child of Player, with its Monitoring set to true. Its CollisionShape2D is the one you can see extending out from the player.

I’ve set the mask on that Area2D to all 16 layers, though for the time being I only have one layer anyway, that includes the players’ own collision volumes and the level boundaries.

My code looks like this:

func _process(_delta):
	# ...
	# (movement handling etc)
	# ...
	if Input.is_action_pressed(_useAction):
		print($UseActionArea.get_overlapping_areas().size())

I would expect that when my player is facing another player, or a wall, and they press their use key, this should print more than zero because it should pick up the player collision objects or the StaticBody2D (and its CollisionShape2Ds) that make up the level boundary. But it doesn’t. Huh? How come?

I’ve also tried adding signal handlers (adding this code to the bottom of my init function), and they don’t fire either:

	$UseActionArea.body_entered.connect(onBodyEntered)
	$UseActionArea.area_entered.connect(onAreaEntered)

func onBodyEntered():
	print("BodyEntered")	
	
func onAreaEntered():
	print("Area entered")

Well, in the hours it took for that post to be approved, I managed to figure out the problem. I added a sprite as a child UseActionArea, and behold! The sprite was always directly north of my player.

It seems I screwed up when I wrote the player rotating code and only had it rotating the player animation node, not the whole player node…