tutorials - text property

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Kharagh
:warning: Old Version Published before Godot 3 was released.

This example from your Docs»Step by step»Scripting (continued) doesn’t work:

A simple way to test this is to create a scene with a single Label node, with the following script:

extends Label

var accum=0

func _process(delta):
    accum += delta
    text = str(accum) # text is a built-in label property

enter link description here

What do you mean by “doesn’t work”? What happens?
Edit: your screenshot didn’t show, I had a look

Zylann | 2018-01-16 13:45

:bust_in_silhouette: Reply From: Kharagh

Follow the link at the question. This is a screenshot.

:bust_in_silhouette: Reply From: Zylann

The tutorial you followed is for Godot 3.0. You are using 2.1.4.

:bust_in_silhouette: Reply From: volzhs

You are seeing 3.0 example, but using 2.x.
that’s for 3.0
if you want to do it, set_text(str(accum)) instead of text = str(accum)

I think the Docs is updated to latest because it’s about to release 3.0
if you want 2.x documents, see this.

just change stable to 2.1 on URL.
Godot Docs – 4.1 branch — Godot Engine (stable) documentation in Englishstable → 2.1/learning/step_by_step/