Trail Mesh always starts from 0,0,0 when generator is a child node

When the generator mesh / transform node is in any kind of hierarchy of parent or child the trail always starts from 0,0,0. you can see this glitch in the playground, if you set the generator to the parent, child, or mesh. but after a few updates the trail works as expected.

I’m using the nested nodes so that i can offset where the trail is emitted from on the mesh, imagine trying to get the trail to come out of a spaceships engines instead of the center of the mesh bounding box.

is there a way to mitigate this glitch? or a better way to offset the origin of the trail mesh?

This PR will fix one part of the problem:

The other part of the problem is that there’s a jump in the position of parentNode when the trail mesh is created and when the next frame is displayed. The trail mesh constructor uses the position of the generator at the time the constructor is called, so if you move the generator far from its initial position, the trail will be deformed.

You should reuse the exact same computation you use in onBeforeRenderObservable to set the position/rotation of childNode before creating the trail mesh:

Note that the PG will only work as expected when the PR is merged.

1 Like

Thank you!