When the project starts, I want to automatically reflect the number of an object in the layer to the global variable. What I mean is, if there are 3 x objects in a layer, I want the global variable to be 3.
Note: The object I mentioned is available in different numbers on each layer.