I think you're after something like:
var offset_x = randi()%100+1
$Viewport/RichTextLabel.rect_position.x += offset_x
Note, that's setting the x
component of therect_position
property of the RichTextLabel
.
Also, the +=
there is adding the random offset value to the current position of the label. If, instead, you want to literally set the position of the label the to random value, change the +=
to just an =
.