Here are some things you can try
- Change your Z elevation sorting code so that it only applies to WorldObjects on screen. You can do this by adding the “is on screen” condition
- The above may result in flickering at the edges of the screen as objects sort as they come on screen. To solve this I like to make an invisible sprite, stretch it 2-3x larger than the screen, and then do an overlapping check with that object for sorting instead of “is on screen”
- Try not doing an overlap check to destroy overlapping objects every tick. You only need that once, after all the objects are created, right?
- Not sure how much this will impact, but you could try only doing greenery health checks after subtracting health from them
- I would definitely try to figure out a way to do your terrain via tilemaps instead of separate objects. You can probably figure out a way to do the 1px lower effect with tilemaps