Spider web - How to make to growing/decreasing web line rear the spider

Hello,
in my 2d platform game I have as enemy a typical spider
When the player approaches the spider starts to go down and up
Over here I have no problem

My problem is that I dont know how make the black/gray line of web connected to the back of the spider
Have you some suggestion or link to investigate?

Thanks

You can use a LineRenderer. If Vector3 posSpider is where your spider’s back is and Vector3 posAnchor the line connects to, you could use

GetComponent().SetPosition(0, posSpider);
GetComponent().SetPosition(1, posAnchor);

to draw the line.

1 Like

Thanks, I will try