I'm attempting to access a tilemap node in the scene tree from a C# class that is not attached to a node. I have a MapGenerator class and I want to pull a reference to the tilemap so I can populate it procedurally. I can't see a need to attach it to a node, even though it works fine that way, but I feel there should be a way to use it as a stand-alone class.
GetNode() fails to find the tilemap node.
I've tried...
GetTree().Root.GetNode("root/World/Tilemap_Walls);
GetTree().Root.GetNode("World").GetNode(Tilemap_Walls);
... and every variation possible (except the correct one maybe?)
The c# class works fine when attached to a node in the scene or if I pass the node reference in a parameter.
I've searched and searched all of the internets for a solution but I thought I would try here before I make a coding commitment.