Infinite runner collection structure

I’m working on a little infinite runner and having some issues organizing the collections and objects so it’s easy to work with. I’m wondering if anyone can see a solution that I’ve missed or suggest an alternate structure.

  • Instead of a level with a start and an end, I have a looping map (like a cylinder) that you go around multiple times trying to complete objectives without dying.
  • I’m constantly moving the map to the left and keeping the player at X = 0.
  • The map is divided into three chunks
    • my “chunk_mover” script moves each chunk to the left each frame and wraps the left-most chunk around to the right side when it hits a threshold

Here is the structure of my Level 1 collection (loaded in via proxy)

Level 1 (collection)
    - manager (go)
        # chunk_mover (script)
    L1_chunk_1 (collection)
        - root (go) -- chunk_mover sets the position of this
            # tilemap
            # collision object
    L1_chunk_2 (collection)
        - root... 
    L1_chunk_3 (collection)
        - root...
    Player (collection)

This all works great, but now I want to start adding other things to each chunk—shops and people that you can interact with—things I want to be “inside” a chunk and move along with it. This would be easy if all my other objects were just Game Objects; I could just add them as children of the “root” game object inside the chunk that I want. The problem is: some of those things are Collections, so they can’t be added as children to a game object. They can have their parent set at runtime, but then the problem is, how do I get the address of the parent (“root”) game object?

Say I have this:

Level 1 (collection)
    L1_chunk_2 (collection)
        - root (go)
        Pizza_shop (collection)
            - shop_parent (go)
                # shop (script) --
                - shop_child (go)

Is there any way for “shop.script” to get the ID of “root”? The name “root” will be the same, it can assume that, but it won’t know what chunk it’s in, “L1_chunk_1”, “L1_chunk_2”, or “L1_chunk_3”.