I couldn't think of the best way to word the title, so I apologise if it's misleading.
Basically I want to make a grapple, more specifically the extendible bit that stretches to the faraway object it attaches to.
At the moment I'm using a line renderer and a simple unlit texture, but it looks terrible. I pondered using a cylinder model and simply scaling in height, but that would stretch the texture. Is there either a better way to achieve what I want, or a way to dynamically tile the texture at the same rate that it's stretching?
At the moment this is the code I am using each update to stretch the line renderer:
// lerp from player towards target with grapple
float t = Mathf.InverseLerp(m_StartTime, m_EndTime, Time.time);
m_End = Vector3.Lerp(m_Start, m_Target, t);
m_Line.SetPosition(1, m_End);
Any help is appreciated.
↧