I have a Player game object with a sprite renderer and a line renderer.
The sprite for its body and the line for a rope.
The problem is that the rope isn't visible (I can see it's drawn in the scene but not in-game).
I can also see the rope if I disable the background.
I have the following sorting layers (in this order):
I have tried multiple combinations of sorting layers and other ordering attributes but none worked. The current one is:
- Sprite Renderer is in the Default sorting layer with an order in layer of 1
- Line Renderer is also in the Default sorting layer with an order in layer of 0
- The background game object has a Tilemap Renderer in the Background sorting layer with an order in layer of 0
This combo worked with no background, but, with it, the line is gone. The values of order in layer were tweaked (before the background) in such a way that the line would be drawn behind the sprite and that worked.
The line positions all have a z value of 0. If I change it to a negative value (say, -0.1f) the line gets drawn on top of everything (even the sprite, which I don't want). I could probably offset the player position in the z axis, but that could mess up some calculations.
Thanks in advance to anyone who's willing to help!