LineRenderer printed behind my other SpriteRenderer

Hi,

I’ve tried to create a laser effect in my game and when i’ve done the part to get the laser to the monster with my line renderer, i’ve added my background image and the linerenderer disapear behind the background.

The Line should be over the background!

5830753--618376--upload_2020-5-10_21-19-17.png

Background:
5830753--618379--upload_2020-5-10_21-22-7.png

LaserProjectile
5830753--618385--upload_2020-5-10_21-24-20.png

I’ve tried many things but it seems nothing is working to make my laser over the background…

#1 - I’ve tried to create Sorting Layer but it stayed the same.

5830753--618373--upload_2020-5-10_21-19-1.png

#2 - I’ve tried with Z Position of the LineRenderer and the Position that have been set.
#3 - I’ve tried with 2 camera

MainCamera to renderEverything except LineRenderer Layer
Second Camera to render nothing else than LineRenderer layer

but it doesnt seems to display my second camera :frowning:

but still all those and nothing my laser is still behind the background! :frowning:

How can i achieve it!?
it seems that many people use LineRenderer in their game, i must be missing something !

ok i’ve finaly found the way to make it work!

but i still doesn’t understand why it need to be that way.

I though that if i put the Z position over my background it would work but no

so background Z = 0
LineRender Position Z = 1 (Position of the Line Positions too at Z = 1)

it didnt’ work…

but if i put the LineRender Positions to -1 it work!? why -1 ?