I hope I can describe this well.
The setup:
I have a scene called gameLevel
I have another scene called iceBlock
I have instanced several iceBlock
nodes into the gameLevel
scene
The iceBlock
scene looks like this:
iceBlock
| - iceBlockAnimationPlayer
| - TextureButton
-- ¦ - iceBlockSprite
The gameLevel
scene, after instancing the iceBlock
scene looks like this:
gameLevel
| - iceBlocksPositionNode
--¦ - iceBlockInstance (named "1")
--¦ - iceBlockInstance (named "2")
--¦ - iceBlockInstance (named "3")
--¦ - etc
So essentially I've brought in the iceBlock
scene, placed it under a position node just for grouping and then renamed them all 1, 2, 3, etc.
Now, the fun part, and the question:
Back in the original iceBlock
scene.
I have a signal setup for the textureButton
release that runs a function.
Now the trick. How can I get the name of the instance root? For example, looking above I'm looking for the name of iceBlockInstance (named "1")
if I click on #1. iceBlockInstance (named "2")
if I click on #2. Etc.
I've tried so many variations of getnodes and getparents and getroots/gettrees etc etc that my head is spinning. Obviously I'm not fully grasping the concept of a child referencing itself from when it's instanced and then calling its parent! :-) I mean, should be easy right. :-) (I jest at my own logical ceiling)
Remember. The function is running from within the original iceBlock
code. It's then instanced into the other scene and run.
I hope that makes sense and I hope someone can nudge me in the right direction. You've all been very helpful and I do appreciate it.
Thank you....