- Home /
Line Renderer with sprites
I am attempting to create a laser beam affect in a 2D, sprite based space game, but I am having issues. I am trying to use a line renderer to achieve the effect, as that is what I have seen recommended, but it doesn't seem to play very nicely with sprites. If I don't set the line renderer material to one of the Sprite ones, then it appears behind any sprites, unless I adjust the z axis of the sprite. It doesn't matter what sorting order or level I give the sprite renderer- it will always be behind the sprites at the same z depth.
If I use a Sprite material (like Sprite/default), then it handles the sorting just fine... but then I can't add a texture to the line renderer to make it look more like a futuristic weapon of death and excitement instead of a plain colored line.
I can probably just ditch the line renderer and use a sprite that I can stretch to be the proper length and width, but I wanted to check to make sure I wasn't missing something simple! How would you go about making a 2D laser beam that looked cool and could be sorted properly in the 2D environment?
Your answer
![](https://koobas.hobune.stream/wayback/20220612150350im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to use line renderer to create borders around an 2d object? 1 Answer
2D Games with Unity? 2 Answers
Make 2D sprites glow? 4 Answers