— I was thinking of something similar, but splitting all my objects between the two layers where the base or ground touch portion of each object lives on the lower level and has as solid behavior, then the upper portion of each sprite lives on the upper layer where my player can just walk behind it.
Is there any performance hit for your method of swapping the layers for the sprite? Would it not work just to have all of the objects on the layer above the player, and just set a tile on the lower layer to solid that matches up to the bottom portion of the object? For example have the tree be on the layer above, but on the lower layer have an invisible tile that matches up with the location of teh base of the tree and set it to solid? Then you would not need to do any switching.