Hey there! I've got a simple project right now. Here's my scene...
In my Player script, I want to reference the Collision Tilemap layer. I know of get_node() but that checks the immediate children of the node calling it... what's the best way to accomplish navigating the scene's tree?
Howdy! I believe I've actually opted to move the Player node into the Collision layer and have the two communicate to detect collisions. That being said, if anyone has an answer or suggestion to the original post, I'd still love to see it. : )
Node paths work like folders on the command line console.
To get a sister node, you can call like this:
get_node("../Collision")
You can also get the root node and move down from there:
get_node("/root/Scene/Collision")
Hope that helps.
@cybereality said: Node paths work like folders on the command line console. To get a sister node, you can call like this: get_node("../Collision") You can also get the root node and move down from there: get_node("/root/Scene/Collision") Hope that helps.
@cybereality said: Node paths work like folders on the command line console.
Thanks man, this explanation actually beats all the Google searches I did and fixed my problem! You're a lifesaver <3
Cool. So glad I could help.