I’m doing a 2D plataformer wher you collect coins after touching them
This is my script for it:
func _on_area_2d_body_entered(body):
if body.get_name() == “Player”:
global.coin += 1
set_visible(false)
get_node(“main/Area2D”).monitoring = false
The problem with it is that after I collect the coin the area where it was collected will still keep increasing the variable. How can I disable the area 2D node for this to properly work?