First, let me set the scene. I am making a 2D RPG. There is a player and there are monsters. Each Monster is stored in a Family called Monsters.
So my issue is... When a Player is below a Monster and they walk up to said monster, the Player sprite is on top of the Monster (based on Z-order) which is what I want, but, if the player is above and walks down to the monster, the Player sprite once again is on top instead of below the monster sprite (based on Z-order). I created a quick fix by using "Every .5 seconds > Compare Monster.Y to Player.Y and Move them accordingly. Unfortunately this changes every Monsters Z-order. For now this is fine because the player can only be in one spot at one time but, down the line, I know I am going to have issues with this and I would like to fix it now.
I am considering using "For Each" with the Family Monsters Object. Will "For Each" apply to each value inside the Family or will it apply changes to the entire Family at once. Do you have any suggestions for how to handle this?
If this has been answered, I apologize. Searching for "For" and "Each" is considered too common by this website, haha.