How to add more options to OptionButton

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

How to add more options to OptionButton ?
Need to use GDScript?

:bust_in_silhouette: Reply From: Chr_

Find it,
get_node("OptionButton".add_item("Item 1")

For more Items with similar name (Item 1,Item 2…Item i+1)

for i in range(0, 9): // From 1 to 9
		get_node("OptionButton").add_item("Item"+ str(i + 1))

thank you,
that is very helpful

catcarrot | 2023-03-23 15:12