a better way make the coins is what i want
Roughly:
Right click on AnimatedSprite2D and choose “Save branch as scene” (This give it a name and a folder as a tscene file.)
Open that new scene, let’s call it “coin.tscene”.
Add a script to the AnimatedSprite2D and then wire-up the signals to that script.
Remove AnimatedSprite2D and 2D2 from your main scene.
Drop the “coin.tscene” you just made into your tree.
Back in the coin scene, you will have to fix the references to ‘$CharacterBody2D/Camera2D/score’ as it’s not in coin.tscene
To do this, add an export to the top of the new script.
@export score
Replace $CharacterBody2D/Camera2D/score`` reference with
score```
In your main scene, select the coin you just dropped and look in the inspector. You should see a new player
variable. Drag your score label into the slot.
Then save all that and try run it.
The basic idea is to encapsulate (wrap) things into logical units. A coin is a coin is a coin: so make a coin scene. Use exports (and there are other means too, like Autorun scenes) to keep references to things in parent scenes.
HTH