I am not sure what you mean by going through the root object… However, that prompted me to move the code where I am trying to access the tilemap into the exact collection that’s being rendered and the same issue.
When I specify the collection name in the URL I get the following issue:
print(tilemap.get_bounds("0-0:/map#tiles"))
function called can only access instances within the same collection.
Once I moved the script code into the collection, the same path did not work.
print(tilemap.get_bounds("/map#tiles"))
Instance /map#tiles not found
I also tried adding root:
print(tilemap.get_bounds("/root/map#tiles"))
Instance /root/map#tiles not found
So I tried a relative path and it worked.
print(tilemap.get_bounds("map#tiles"))
Because this is loaded via a factory, I cannot use /map#tiles. In a collection not loaded through a factory, the URL would normally work and I wouldn’t need to use a relative URL. However, since it’s going through a factory the path is different and I am not sure what the absolute URL is.