So I'm trying to use the line renderer to draw a vine from a boss to a tree, but i want it to draw the end of it differently. I've been going absolutely coocoo trying find a solution but to no avail. The image is edited to show the desired result.. Hope at least SOMEONE looks at this post ;-; :exhausted:
#Line renderer with different end texture
1 messages · Page 1 of 1 (latest)
I see two solutions here :
- A custom shader : can be a bit tricky to do
- Just slap a quad/sprite object at the end of the line 🙂
a quad?
@ancient basin wdym by quad?
I added a small gap to better visualize, but here I have a line renderer on the left, and a quad on the right :
@surreal kayak
Wait what
How'd you do that??
@ancient basin
I googled what a quad is and apparently it's a sprite polygon
I've tried using that as well, but it didn't work
Oh. Is it only for 3d objects?
The line renderer has a material with the tiling texture, and the quad an other material with the end texture that matches.
No, it should also work for 2D.
The line renderer is a 3D object to start with anyway.
Ok thanks, I'll ping again if I run any more problems with it
Do you want it for 2D though ?
Is the "thing" supposed ot be straight ?
There you have an even easier solution, let me set that up for screenshots
You can use the sprite renderer with a "9-slice" sprite : https://docs.unity3d.com/Manual/sprite/9-slice/9-slice-sprite.html
is the vineSlice the quad at the end?
Here I made a right only border, that separates the end of the repeating section of a single sprite image.
Assign it to a sprite renderer with "tiled" mode, set to the proper size, and it will repeat the "center" section, while only have one "end" section, allowing you to have a dynamic dimention of vine.
what does the line renderer look like for you with this setup?
It's no more a line renderer. It's a sprite renderer.
o h .
The VineSlice is a single texture like I mentioned.
