Animated Mesh from Blender not Billboarding

Hi all,

I’ve exported a glb from Blender with a few animation tracks. I’ve got it to animate when the user clicks ‘play’ & then once finished ‘activate plunger’ sprays mist out of the tube (which is a png, texture mapped to a plane in blender)

1st Question: The plane is just fired off-screen on the last frame of the animation but is there a way to get the plane to disappear completely at the end of the animation instead of this workaround?
2nd Question: Is it possible to billboard the plane so it always faces the camera on the Z-axis?

Playground Link

Please excuse the code - I am a 3d modeller and know very little about coding! Just a copy and paste job :wink:

Thanks in advance,

You can use onAnimation observables: (starting from line 30).

About billboardMode, adding sprayPlane.billboardMode = BABYLON.Mesh.BILLBOARDMODE_Y; doesn’t do anything, I think it’s because animation keys overwrite mesh rotation values (note that I’m not sure about this).

1 Like

Thanks for the quick reply!

I’ve updated the animation and the onAnimation observables seem to do the trick.

I’ve also removed the sprayMesh.preserveParentRotationForBillboard = true;
so that the billboarding isn’t overwritten by the rotation values. But it’s now firing the animation off the wrong axis.

Thanks again for looking into this - I think it may not be possible to do what I want to achieve from what I’ve seen in other posts but wanted to just double check.