Hello
I've been playing around with top-down 2D to learn and ultimately make my own game, already learned a ton and could understand and solve many hurdles, but now i've been stuck on this for the last day.
Basically i'm trying to be able to pick up weapons that are on the floor by standing on them and pressing right click. This changes the character sprite and "deletes" the weapon on the floor (It will later add a node to the player character with the weapon and it's functionalities but that's not there yet)
I have a player node with an Area2D, a weapon on the ground node with an Area2D, there's a signal on the player for "area_entered" and it is working since the console prints "Pistol (pickup) when i stand on it, but then right clicking does nothing.
func _on_Area2D_area_entered(area):
print(area.name)
if area.name == "Pistol (pickup)" and Input.is_action_just_pressed("rclick"):
$Sprite.set_texture(con_pistola)
area.queue_free()
It's written like this so i can later add a block like that for each weapon.
(The texture "con_pistola" is preloaded earlier in the code, and i tested with some simple lines for "right click to change the character sprite" with it and it worked)
What's wrong? :#
Thanks in advance!