#For loop error
1 messages · Page 1 of 1 (latest)
pretty sure it's for i in len(slots)
also, that doesn't look like the best way to do it
Thxx man
you could, instead, add them all to a "buttons" group
What's your suggestion?
and then do get_tree().call_group("buttons", "set_pressed", false)
it basically just does all that, but in one code line
just makes your code a little cleaner
Thxxx will do that
but for loops are still important to understand
you could also, instead of
for i in len(slots):
slots[i].set_pressed(false)
do
for button in slots:
button.set_pressed(false)
these both achieve the same result, in a different way
Ahhhhh, didn't know that, looks like I've interchanged and combined this two different structure, thx for expanding
what's the difference? the len(slots) still works.
Im calling this function in the parent of this node, and it would be best using the group method rather than referencing it then call the function, right? or nah?
either one works, but the group method does make for cleaner and more readable code
Okie thnx man
dayum im trying to answer some questions for reputation but youve already answered them all 🤣