I'm working on a game where you can switch between the foreground and background to avoid detection by guards. Doing this also allows the player to go behind or in front of solid objects (ie: a stack of boxes in the background can be passed in the front).
Regarding just the player, this is not an issue.
In order to avoid stopping the player from walking passed the boxes (or other objects that would normally have the Solid behavior), I can simply test if the player is on the same layer as the boxes. If not, I turn off the Solid behavior and the boxes are nothing more than sprites.
The problem is when I include the enemies who also will use the Platform behavior and will need to be able to interact with objects that are supposed to be solid (regardless of the layer the player is on). Because if the payer is on a different layer than the solid object, then I'd have to turn off the Solid behavior. But if an enemy is on top of those solid objects, they'll fall through the sprites due to their Platform behavior...no Solid to hold them up.
So I need to work out a different system of collision detection AND, more importantly, how to make "solid" objects act like solid objects without the solid behavior.
So far, I have figured out, for example, how to use Overlap or Overlap At Offset to place the player on top of the boxes when he jumps up and falls to land on top of them. Problem is, if I walk up to the boxes from the side, the conditions still puts the player on top of the box. Part of that, I'm sure, just requires a couple extra conditions to test for the X position as well as the Y position of the player.
Still, even with that understanding, I'm struggling to find the best way to test for these conditions in the same vein that the Solid + Platform behaviors do. May I get some input on this, please?