[SOLVED] Prefab Objects getting pushed behind background image - Sorting Layers

Had a bit of an issue on the prefab lecture where every time the ball would collide with anything, it looked like the opacity of all of my objects would go down (paddle, ball, and all bricks).

Didn’t find anything on here or online about the specific issue, but eventually figured out that the opacity wasn’t going down, it was simple going behind the background image, who’s opacity was already lowered.

If you are experiencing the same issue:

  1. Click on any sprite you have (paddle, ball, brick or background image) And in the “Sprite Renderer” section of the inspector, click on Sorting Layer -> Add new sorting layer.

  2. Add in a Background and a Foreground layer to put your objects on. (You can make as many layers as you want).

  3. Put all of your sprites in sorting layers. Put the background image in the background layer, and put everything else on the foreground.

Hope this helps someone, wasted a little time trying to figure it out.

Resource I used: http://answers.unity3d.com/questions/610165/sprites-become-invisible.html

2 Likes

I had a similar issue. For me it happened each time the scene loaded but only after creating a the second level scene. I was going to comment about using layers with the lecture where he suggests moving the z transform of sprites to address other graphical issue, but thought it would be covered in a future lesson. Thank you for the help :slight_smile:

1 Like

Privacy & Terms