Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | low |
extends Label
var accum = 0
func _process(delta):
accum += delta
text = str(accum) # ‘text’ is a built-in label property.
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | low |
extends Label
var accum = 0
func _process(delta):
accum += delta
text = str(accum) # ‘text’ is a built-in label property.
Reply From: | kidscancode |
This code sets a variable, accum
and updates it every frame by adding the frame duration, delta
. This means accum
is counting seconds since the game started.
The last line sets the Label’s text
property to display the value.
Is there something more specific that you don’t understand or need clarified?