Can you change the draw order of a LineRenderer

Hello!

I have a linerenderer that displays a laser betwen the player and an object. It works great, except that it is drawn on top of the player and the object. (It should look like it stops at the edge of the object’s collider, not go all the way to its origin)

Is there a way to have the linerenderer draw before sprites?

Or, can I make the linerenderer somehow intercept with the object’s collider?

1 Answer

1

I figured it out. lineRenderer.sortingOrder(-1)