#Line renderer with different end texture

1 messages · Page 1 of 1 (latest)

surreal kayak
#

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:

ancient basin
#

I see two solutions here :

  1. A custom shader : can be a bit tricky to do
  2. Just slap a quad/sprite object at the end of the line 🙂
surreal kayak
#

@ancient basin wdym by quad?

ancient basin
#

I added a small gap to better visualize, but here I have a line renderer on the left, and a quad on the right :

ancient basin
#

@surreal kayak

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

ancient basin
surreal kayak
#

Oh. Is it only for 3d objects?

ancient basin
#

The line renderer has a material with the tiling texture, and the quad an other material with the end texture that matches.

ancient basin
surreal kayak
#

Ok thanks, I'll ping again if I run any more problems with it

ancient basin
#

Do you want it for 2D though ?

surreal kayak
#

Yes

#

My game is 2D

ancient basin
#

Is the "thing" supposed ot be straight ?

surreal kayak
#

Yes

#

It's a vine

ancient basin
#

There you have an even easier solution, let me set that up for screenshots

surreal kayak
#

It goes from a boss to nearby trees

#

Which is like 5 or so trees at once

ancient basin
surreal kayak
#

is the vineSlice the quad at the end?

ancient basin
#

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.

surreal kayak
# ancient basin

what does the line renderer look like for you with this setup?

ancient basin
#

It's no more a line renderer. It's a sprite renderer.

surreal kayak
#

o h .

ancient basin
#

The VineSlice is a single texture like I mentioned.

surreal kayak
#

it's not quite what i was after, since it tiles from the end of it..

#

IT WORKS!!!

#

@ancient basin TYYYYY

surreal kayak
#

@ancient basin btw how would i set the vine to move towards a dynamic position?

#

because it's not like setting a line renderer position