I have two players. Player1 and Player2. (both are KinematicBodies2D).
I also have a Area2D.
I want that when Player1 enters the Area2D then make the sprite not visible.
(Sprite name: g1 ($g1.visible = not $g1.visible)).
And when Player2 enters the Area2D then make the sprite not visible.
(Sprite name: g2 ($g2.visible = not $g2.visible)).
And I have connected Area2D node signal on function "body_entered" with both player1 and player2.
So my problem is how to make that when Player1 enter the Area2D then send signal to player1 code AND NOT player2. And when player2 enter the Area2D then send signa to only player2 code and not player1.
Please help.
I have been stuck in many days.
Here are pictures on Player1 code, Player2 code, Area2D code and signals.
https://ibb.co/jh38cLh
https://ibb.co/6chMBBt
https://ibb.co/KxmckwQ
https://ibb.co/zFGQSyZ