#plz help
15 messages · Page 1 of 1 (latest)
This get_parent().get_parent().get_parent().get_child(4).get_child(0).get_child(i).get_child(0).get_child(1).text is a nightmare.
Learn about exports so you can reference that text directly.
No. You need a better way to reference which sound is selected that's easier to deal with and reference here.
You are reading a directory and creating UI elements for each sound. Then when the player clicks play you're referencing those UI elements to find out which sound it is, right?
You can do that with an Autoload.
Your errors are from this incredibly awkward and error-prone system that YOU created.
So I would use an Autoload scene to maintain a list of my sounds. Then I would have a nice array of sounds which can be referenced by their index in the array.
When you want to populate the UI list of sounds, reference that list and build them.
When you want to play the sounds, reference that list again.
So I would use an Autoload scene to maintain a list of my sounds. Then I would have a nice array of sounds which can be referenced by their index in the array.
When you want to populate the UI list of sounds, reference that list and build them.
When you want to play the sounds, reference that list again.
😄
No clue. Ask me about Godot. :3
Good luck with it. ♥
Making it shorter isn't solving the problem