I try to create a Linerenderer (Positions update every Frame) which uses a texture that is repeated depending on the needed length.
Therefore I tried the following:
- Creating a reapeatable texture

- Creating a Material (Sprite/Default Shader) which uses this texture.

-
Changing the texture’s scale when needed:
//Update Linderenderer
linerenderer.SetPosition(0, transform.position);
linerenderer.material.SetTextureScale(“_MainTex”, new Vector2(hook_joint.distance,1));
Debug.Log(linerenderer.material.GetTextureScale(“_MainTex”));
The Debug Log shows that the texture scale changes over time, the change is however not visible?
Do i change the wrong texture on the material or is this kind of approach totaly wrong?
I allready found several answers to this question , which range from using special shaders to chaining linerenderers together (multiple linerenderers with fixed length) . Most of these answers however do not cover the use of a transparent key in the texture (my chain has holes ) or do only work in 3D.