i want to create a dynamic trail behind an object (sword). basically the unity linerenderer and trailrenderer dont quite do the job. so can i acess and modify the linerenderer script somewhere?or what is the best practice to create and modify vertex data in realtime in unity? any tip or link to documentation appreciated what i am trying to do: the trail is supposed to behave similar to a flag, meaning the quads span between the two ends of the blade. adding a new quad which connects to the new positions every frame, removing (or recycling) one, scrolling uvs etc
i found and made what i was looking for a quick rough implementation for other to use needs to be attached to a GameObject with a Mesh filter and mesh renderer, p.e. the basic plane overwrites the mesh content on runtime
Thanks for the script!! I wrote a complete multi line renderer from your script that combines, weld, optimize all vertices. There are 2 small issues I have fixed. 1) The length of the horizontal UV's are too short. 2) the texture is mirrored Code (CSharp): uvs[i] = new Vector2(0f, (float)i / (float)vertices.Length); uvs[i + 1] = new Vector2(1f, (float)i / (float)vertices.Length); exchange with: Code (CSharp): uvs[i + 0] = new Vector2(1f, (float)i / (float)vertices.Length-2); uvs[i + 1] = new Vector2(0f, (float)i / (float)vertices.Length-2); Further your need: Code (CSharp): m_mesh.RecalculateBounds(); m_mesh.RecalculateNormals();