Godot Version
4.0
Question
I am trying to get my game manager nodes function that increases the point anytime the cherry is touched and update the score label but i get this error
Invalid assignment of property or key ‘text’ with value of type ‘String’ on a base object of type ‘Nil’.
Heres my code for the game manager:
extends Node
var points = 0
@export var label :Label
func _ready():
pass
func addPoints():
points += 1
print(points)
label.text = "Hello World"
Here is my Cherry code:
extends Node
func _on_cherry_body_entered(body):
if body.name == "Player":
GameManager.addPoints()
queue_free()
Here is my Node Tree