So in my 2D game I have a prefab that I use as a base for all my player ships called PlayerShip, each ship has a main body and a gun as you can see:
Both of those gameobjects have a sprite renderer attached to them, the PlayerShip has one for the ship, and the gun one for displaying the gun of the ship, like so:
PlayerShip gameobject
Gun gameobject
Then I just create some prefab variants that give those sprite renderers their correct sprite. The problem occurs with the first ship I try putting a sprite for the gun, it shows above the ship on the editor but when I hit play the sprite doesn’t even appear:
Editor view
Play mode view
I searched online for this but all the answers I could find where about the camera transform, or the sorting layers, my camera transform Z component is -10 at runtime and as you can see in the screenshot the Gun transform Z componente is greater than that so I don’t think that’s the problem, also heres how my sorting layers are implemented:
Any clues on to what is going on?