Area2D signal triggered when other bodies are instanciated

When the game starts the player will pick up an object and move to the location where it needs to be stored. The player with object in hand enters an Area2D of the storage container, this then triggers a signal that the body of this object has entered it and set a bool to true.

The Issue
While stanbing in this Area2d the player is unable to store said object. This is due to the fact that the signal is being triggered by the same object type being instantiated else where in the level setting the bool to false.

func _on_left_tube_body_entered(body):
	if body.is_in_group("letter_medium") and player.object_in_hand == body:
		#if player.object_in_hand == body:
			left_tube = true
			print("Entered Left: medium letter")
	#if typeof(body) == typeof(LetterMedium):
		#left_tube = true
		#print("Entered Left: medium letter")

This is a mix of what i have tried so far with no clear solution.

What I think I am trying to achieve is that the object in hand will be the only thing the area2d looks for and ignores the same objects that are being instantiated.

Thanks in advance!

You can give the object a custom bool that the players sets to true when he picks it up, so all the other objects are still false. Then you can just check for that bool

Do you have an example please? I have currently discovered that this is happening on a number of things that check for these objects.

sure:

# your object-script
var player_object: bool = false

# your player-script
func pick_up(my_object):
	my_object.player_object = true

# your area-script
func _on_left_tube_body_entered(body):
	if body.player_object:
		left_tube = true
		print("Entered Left: medium letter")

This method still triggers every instantiated object.

func _on_left_tube_body_entered(body):
	if player.object_in_hand == body:
		left_tube = true
		print("Entered Left: medium letter")

I have code that focuses on the object in hand, however, I feel there is something else going on as when i start the game, the first object i pick up gets stored… Think I have broken my game! woohoo

Yeah sorry it supposed to look like this:

func _on_left_tube_body_entered(body):
	if body.object_in_hand.player_object:
		left_tube = true
		print("Entered Left: medium letter")

Didint work unfortunately. I dont think its wrong I think my code elsewhere is doing something wild. I’m just a bit clueless tbh, appreciate the help though.

If you need help just paste code here