Problem with the RichTextLabel.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Nick888

Hello guys.

I asked a question yesterday with title “Counter and Signal”. The issue now is this:

I have an Area2D named “Ambulance”. So, i send a signal from Ambulance to the
RichTextLabel. The RichTextLabels 's Script is the following:

var score=0
func _on_Ambulance_body_entered(body):
	score=score+1
	set_text(str(score))
	pass

The problem is that every string-number is written on the previous one …I mean that when i have the string-number 1 written on the RichTextLabel ,subsequently the string-number 2 is written on the string -number 1 and also subsequently the string-number 3 is written on the string-numbers 1 and 2…That is, one over the other.

Is there a way that i can replace the previous string-number with the new one?

Thank you.

:bust_in_silhouette: Reply From: Nick888

I noticed that because of the Ambulance (Area2D) is together with the RichTextLabel in a scene 2, the main scene plays all the time the scene 2.So,thats why the string-numbers are one over the other.I will appreciate if you guys have a solution here.