i am making a pong game, i'm trying to update the score values but because they're labels ( and therefore the text is of a string data type), i have tried casting but it doesn't work. How could i increment the values in a script

Keep the score in a dedicated variable.

extends CanvasLayer:
	
var scoreLeft = 0
var scoreRight = 0

func _on_Ball_left():
	scoreLeft += 1
	$leftSideScore.text = str(scoreLeft)
	
func _on_Ball_right():
	scoreRight += 1
	$rightSideScore.text = str(scoreRight)

    xyz Thanks for the help

    i am still getting an error tho. why am i getting this?

    Making mistakes is a beneficial part of learning. (An exception would be learning to use hand grenades.)

    sebthepower Don't worry about that, it's how you learn, by getting it wrong and then working out WHY you got it wrong and eventually getting it right.