Godot Version
Godot v4.3 stable steam
Question
` Hi, I am very new to coding, game dev, Godot. I am trying to make a game with many levels and i have a stars system. I want to show how many stars on each level button’s top. I added a TextureRect to each level button(Button node). Everything works except the stars on top of buttons and this is my related code in level_selection script:
func _ready():
for button in $VScrollBar/AnimalsLevels.get_children():
if button is Button:
button.connect("pressed", Callable(self, "_on_level_button_pressed").bind(button))
for level_button in get_tree().get_nodes_in_group("animals_levels"):
var level = int(level_button.name)
var stars = Global.get_stars(level)
var star_texture_path = "res://assets/star_" + str(stars) + ".png"
level_button.get_node("StarDisplay").texture = load(star_texture_path)
My paths are correct, names are correct, Visible properties are on but i couldn’t get a result, please help`