Hi, Im struggling with a problem that I'd be very grateful for help with.
In my game flowers (one object) appear at random places within a set area, I am trying to make it so that when a new instance is created it detects if there will be an overlap with an instance of that object that has already been created, check its y-position and then if the new instance has a greater or equal y-position it'll move the new instance to the top in the z order.
I hope that makes sense?
Effectively I am looking to make it so that when a new instance of an object is spawned it'll place it either in front of or behind previous instances based on how high up tghe screen they are - giving a sense of depth.
Everything I've tried so far hasnt worked as Im dealing with instances of the same objects (I can do it if its sorting between different objects!)
Thanks