So im making a simple 2D game and im having some problems with collision.
I want my character to basically die,trigger a Particle2D node and restart the scene when he collides with an object.When he collides the game crashes and i get the error:
Invalid call. Nonexistent function 'defeat' in base 'Area2D (player.gd)'
The obstacle node is connected to onobstacles
This is the code on the player script :
And this is the code in the obstacle script :
func _on_obstacles_area_enter( area ):
Idk why the script doesnt recognize the defeat function on the player script.