I have a Gameplay scene where I have instanced Player scene that contains Player.gd script. The issue is that I have this function in my Player Script that is responsible for displaying score on screen :
var scoretext = "Score : " + String(global.score)
This is scorelabel where score is of type CanvasLayer and is child of Gameplay node which is my main scene :
onready var scorelabel = get_parent().get_node("Score/RichTextLabel")
The issue is that when I call this in the
func _process(delta) or
_physics_process(delta) the score gets updated but every frame it stacks up and goes on forever without clearing the previous text on label. If I call this in
func _ready()then the score never updates. I don't know what the problem is. How can I fix the issue ?