Sprites appear different in game

I am having a problem in my game where the sprites appear differently in the viewport to how they do in the game.

Everything appears in place in the viewport view…

…but as soon as I press play the sprite colours change, and they appear out of place to how they should. I checked the y coordinates for the sprite positions, but even when the offending sprites are behind others, they appear clearly as if they are in front of them.

Does anybody have any ideas how to fix these problems?


It took me a while to figure out what exactly the issue here is, so i added a pointer for everyone else:


I am by faar a professional, but i guess it has something to do with the transparency and depthcheck.
To my knowledge UE4 cant handle multiple translucent objects stacking over each other; their depthcheck order gets messed up. Either set your materials from translucent to masked, or try this:

Select your Actor in the viewport, and find the ‘Rendering’ Tab in it’s Detail Panel:


Here you can adjust the objects depth priority, try fiddling around with different values and see if that helps.
The further your objects are away, the lower their sort priority should be.

For example:


Sorry for being so inexperienced but how do I change the material to masked?

My guess is that I need to change the default material.

In the meantime I will try your other solution. Thanks so much for your help!

Edit: I tried your other solution and it seems to have worked but…

…the colour difference is still lost. For some reason the “middle-ground” sprites become the same colour as the foreground ones. The rgb values are very similar. R: 0.04, G: 0.04, B: 0.04 for the middle ground, and R: 0, G: 0, B: 0 for the foreground. I still don’t understand why they appear different colours in the viewport to how they do in the game though. A long fix would just be to re-colour the sprites and replace them if there is no other solution.

To change your material to masked, open it and set the blendmode to “masked”. This is what your texture should look like:


Please notify that the texture’s alpha channel is hooked into the opacity mask, not into the opacity.

Thank you!

omg thank you gays i was have the same problem in my 2D game and i’ve tried to solve it for months but I couldn’t
and now it solved thank you million thank
you can get a free Beta version as a Gift