Hello! My 2d platformer game is structured like this:
The problem is that the player’s script needs to access the tilemap and other nodes.
If I do get_node(‘/root/level03/tilemap’) it works but then the next level04 won’t work.
If I do getparent().getchild(0) it also works but then I have to remember to keep the same structure all across the levels.
I thought in something like store a variable CURRENTLEVEL=00 and increase it and then just getnode(levelCURRENTLEVEL /tilemap) would be perfect but I can’t make it work
Is there any other way to do it?