how do i fix 2 area2d's colliding with each other when touched/clicked

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

I have 2 separate area 2d’s one for the background and one for the sprite, now in my game the sprite is going to spawn on the background and to get points in my game you have to click the sprite, now the background is like an enemy if you click the background its game over, but what happenings is if you click the sprite the backgrounds collisionshape also gets the input somehow, i have tried many things but none have worked please how to i fix this.

How are you getting input now? This seems like a use case for _unhandled_input on the background and using set_input_as_handled in your sprite. There’s some guidance in the docs here:

Using InputEvent — Godot Engine (stable) documentation in English

spaceyjase | 2023-02-17 11:49