New to coding; though I’m picking up on it a lot quicker than I’d expect. But I can’t wrap my head around this one thing and it’s driving me insane.
How on earth can I achieve a BoxContainer-like effect with 3D nodes?
Let’s throw out some placeholder nodes to work with. I have a Node3D named Hand as a child of the Player scene, and several instances of a scene called “Cheese.”
Each of these Cheese instances is going to be parented to the Hand, and while in their resting state they’re going to be visually “in” the hand. Problem is, I’d like them to spread out along the X axis- dynamically- as if they were cards in a card game… and I just don’t get the basics of how I’d achieve this.
I know I’d probably need some variable stored in each separate Cheese instance to determine their spread, and I know I’d change it by accessing the child array of the Hand, but I don’t know:
-
how to reliably get specific children via _get_child() (index access just doesn’t seem practical when children are gonna be coming and going frequently in the finished product)
-
how to establish the hand boundaries
-
for all intents and purposes… pretty much any aspect of this method; I can’t even come up with some rough proto-code, this is just a massive gap in my understanding (or I’m overthinking it)
I mean I’ve tried to research, but using the documentation for any given thing requires a context-specific level of understanding that’s just not there right now, and the only tutorial that exists anywhere for this kinda thing lacks any actual information on the method/code (and is more of a concept demonstration).