Create Two Overlapping Sprite

Hi, I have Two sprite object using transparent png file as texture. They have an intersection point. However, when the intersect sometimes Sprite1 is above, sometimes sprite2 is above. I want to keep anyone of them always above the other one.

N.B. I am always updating sprite1, sprite2, camera in the animation loop. in this order: sprite1, sprite2, camera . I want sprite2 to be always on top of sprite1. I mean the intersection part between them.

Does it work if you define a value for sprite2.renderOrder? Try it with a value of 1.

Hi, it seems partially solve the problem, however it creates another problem. In this case sometimes my sprite1 background seems visible over sprite2. Both of them having transparent background. My scene background is ‘grey’. The color of the sprite is dark grey. But when I set render order, sprite1’s white background sometimes is seen covering sprite2. It’s because when sprite2 rotates, it covers some part of sprite1 and I want that part of sprite1 to be hidden by sprite2.

Hi, it doesnt work. If i set renderOrder for sprite2=1, the intersection point of them is covered by sprite1.
Look at this without renderOrder:
Screenshot 2023-01-20 at 9.49.52 PM
And this is with renderOrder:
Screenshot 2023-01-20 at 9.50.43 PM
My background color is grey btw.

Do you mind setting the depthWrite property of the sprites materials to false? Does the glitch in the second screenshot go away?

Hi, this works like a charm…thank you so much