Looping through camera layer array

I am starting to add quite a few layers to my scene to have different foreground and background objects in several overlapping heights. I have the camera following a player character in the scene. Instead of adding more actions for every layer added to the game, I’ve set up an array with the layer names to use with the “For each child” event. As per below:

It’s only moving base layer right now though, as if it wasn’t able to pull the layer name from the array. But, I tested the logic using a text box and the same For every child loop was able to put the text into the text box.

Anyone have any idea what the problem might be?

Possibly is because the VariableString(layername) is empty so GD understand this as “” and that is how base layer is identified
If you want to loop through 0,1,2,3
Store the child into a variable and use that variable as parameter to (layer: YOURCHILD VARIABLEHERE, camera:0 )

I tried that out and realized it was the opposite problem: all of the other layers were working except the base layer! I had set up the scene variable with empty string thinking that would match to base layer, but that doesn’t work.

It seems that at compile time, gdevelop defaults empty string variables to the number 0 which does not match to empty string anymore. To get around it, I added a setup step in the events to set the variable to empty string during runtime, and now the base layer moves.

So lesson learned is you can’t set string variables to empty strings in the scene variable editor.