Put text from optionbutton to richtextlabel

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Jarle

I’m nob in Godot and I have filled optionbutton with text from a csv file and I try to transfer the choosen text value to a richtextlabel. Can someone advice me with either a turtorial or a sample.

:bust_in_silhouette: Reply From: Wakatta

Connect and use the item_selected signal as follows

func _on_OptionButton_item_selected(_index):
	$RichTextLabel.text = $OptionButton.text

#if you want the text set on creation as well
func _ready():
    $RichTextLabel.text = $OptionButton.text