+1 vote

I have a random number generator that generates a number used for calling show() on a node (e.g. items[number].show()). Is there a way to do something similar to items[ "not in" number].hide()?

Godot version v3.4.4
in Engine by (101 points)

1 Answer

0 votes

You could iterate over each item in the list, keeping track of the index i. When i == number, then you call items[ix].show(), otherwise you call items[ix].hide(). Would this solve your problem?

by (990 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.