This function still does not work for me. I attached a script to the "Label" element in my 2D scene and replaced "$ Label.text =" with the usual "text =". I don’t know what this is connected with.
Here is the code:
extends Label
var text_variants: = ["text1", "text2", "text3"]
func show_random_text () -> void:
text = text_variant [randi% text_variants.size () - 1]
Throws an error at 7.23
I'm not that long at godot yet.