Same sorting layer and order in layer rendering

Lets say all my objects are in the same sorting layer and same order in layer.
If i have one object stationary in some location, then how do i MAKE SURE that another identical object moved to that location will render above it. How does unity3d decide what renders on top of what when both objects are in the same sorting layer and order.

I don’t know if you still need an answer for this question, but Unity has a video explaining the behaviour of sorting layers here.

In essence, the draw order depends on the following in the order of precedence:

  1. The sprite’s sorting layer’s order - the order can be arranged in the “Tags & Layers” menu
  2. The order within the same sorting layer that the sprite is assigned to - higher the order, the “closer” it is to the camera
  3. The “z-depth” of the sprite - i.e. sprites closer to the camera will be drawn on top of those that are further away

For example, if we have 4 sprites (A, B, C, and D) and 2 sorting layers (SA, and SB, SB draws on top of SA) in the following configuration:

  • A - SA, order 0, z-depth 0
  • B - SA, order 1, z-depth 0
  • C - SB, order 0, z-depth 0
  • D - SA, order 0, z-depth -1 (i.e. closer to the camera)

Then the rendering order closest to furthest from the camera is: C, B, D, A.