Area not detecting when I press a key?

Godot Version

4.6

Question

Hello!!

I was trying to figure this out on my own but no luck. I have a ring and an area that i want the ring to enter, and if the player touches the left arrow, it would print something (for now), but its not printing what i need it to?

This is the code for the area i want the ring to enter btw:

func _on_blue_arrow_area_entered(area: Area2D) -> void:
	print("Ring entered!!")
	bluearrow.visible = true
	if Input.is_action_just_pressed("left_arrow"):
		print("Ring touched!!")

Its detecting the ring and its making it so that the arrow shows (and disappears) depending on if the ring is in or outside of the area, but when i press the left arrow while the ring is within the area, it doesnt do anything? (I know the key is in my input map as well)

Any help is greatly appreciated!!

If this function is connected to the area_entered signal, it is only called once in the exact moment another area enters. Checking for an input in that exact moment won’t work.

Use some other process or input function (like _input()) to detect the input, and check if the areas are currently overlapping there. (Or if bluearrow is visible, if that coincides with the areas overlapping.)

1 Like

ahhh thank you! I thought that could have been the problem but wasnt sure :,D thank you so much!!