extends Node2D
func _randomize():
var a = 0
a = randi()%10 + 1
$RichTextLabel.set_text(str(a))
print(a)
func _process(delta):
if Input.is_action_just_pressed("ui_accept"):
_randomize()
When the label text is set to "a" and when "a" is printed I am given two values. I have tested this on other nodes and with many variables, with 2 separate values being the minimum. I know I messed up somewhere because i only get one value in a new project and I know the issue of a declared variable being edited by multiple functions. I apologize if this is common sense, as I am new to coding and have no idea how to fix this issue. Any help would be appreciated, thank you.