I scripted a simple polytrail system, for weapon trails and the like, but I ran into a little problem.
When moving vertices with a script, it’s only possible to use a local coordinate system, which means I had to figure out how to convert the local system to a global one (the trail object needs to be parented to whatever it’s following, or else it gets culled when the centerpoint leaves the camera frustum)
My answer was to vertex parent it so I didn’t have to deal with converting orientation coordinates, and then add the change in object position. This is all fine and dandy, but the offset seems to be a frame behind- if the parent object is moving too fast the whole trail moves around.
I can’t figure out what I can do to fix the problem, any ideas?
The example file is hardly commented, but the only important part is the offset and that’s pretty simple.
You can shorten the trail by removing segments from the end (or reducing the delay variable, if it’s above 0)- just remember to get the UV’s back in order after.
Unparenting the trail and setting the position works perfectly. Now I just have to figure out the issue of instancing, I hear that may be solvable come 2.49b, with the mesh updating additions.