#Help Needed: My Script Isn’t Working – Coin Pickup Doesn’t Add to Label or Start the Game
6 messages · Page 1 of 1 (latest)
this is only the part of the code that sets the text of the lable to the ammount of coins. How does the coins-variable get increased?
extends Area2D
func _on_body_entered(body):
if body.is_in_group("Players"):
$AnimatedSprite2D.play("Collected")
await $AnimatedSprite2D.animation_finished
GameManager.coins += 1
queue_free()
its +1
and this is my gamemanager extends Node
var coins = 0
var score = 0
func _process(delta):
pass