Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Scavex |
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 :
func scoreDisplay():
var scoretext = "Score : " + String(global.score)
scorelabel.add_text(scoretext)
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 func
_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 ?