2D Text label attached to animated FBX

Hi. I guess it’s simple but no way no find out how:
This is the typical exploding/imploding object to see its parts. It has a label now always facing camera via primitive+ script. But if I parent it to the object it does not move because it is an static object (always at 0.0.0). Animation is an asset that uses the FBX animation (explo/implo).
What I need could be solved in several ways:

  1. Labels attached to every object, linked to some vertex so it moves with the object. In that case they should dissapear when the object is joined ( no insides).
  2. Easier: labels don’t move, they appear only when object explodes. Then dissapear when object closes back to normal. But I don’t know how to make them dissapear and appear syncroniced to implo/explo animation.
    I have come from animation background so it’s very easy for me to even animate text labels in another FBX according to what happens there, but when I do so, scripts to force “target to camera” screw up the animation…nothing seems to work fine.
    Though point “1” would be great, solution2 would be enough. Any help in this problem very appreciated. Thanks

Hi @Juanjo3D,

The easiest way to bind the translation of an entity to an animation is to attach it as a child to one of the animation bones.

That way the translation of the entity will update automatically and follow the bone’s transformation.

For text elements make sure that they are added to a 3D screen (not a 2D screen, disable the screen space property). That way they belong to the world space and can follow the animation.

Try searching in the forums for attach to bone and you will find several posts on how to do find and add an entity to a bone using a script.

Thanks. Impossible to reach bones but I know they exist. Y finally exported a synchroniced anim for a single label, then multiple materials. It works but it would be better if labels don’t scale with perspective…more elegant. I guess I need to take a deeper look into playcanvas.
This is how it looks now:

Bye and thanks again

Which bones are you looking for @Juanjo3D? Maybe I can take a quick look at the build?

Here is the list of graph nodes that you could attach or follow with other entities. Are any of these the bones you are looking for?

Thinking on 2. You could use the animation time make labels appear/disappear based on the time value. Eg if it’s at 0, labels disappear.

1 Like

Hi. In today’s version no bones. Those children are the FBX layers belonging to the main layer. but I could not find the way to open that panel. I guess in last week version ( wich had bones) , they would appear in the list because I can see Nulls…everything I can not see but was there when I exported FBX. The 3D interfaces I’m used to are quite different I guess.
It seems easy to use but more experience needed.
My second work with playcanvas sorry. But the runaway from another webGL apps has no more options. Thanks

Would you be able to send me a copy of that FBX please? Even if you have moved on from PlayCanvas, it would be great feedback for us if there’s functionality that’s missing from your use case.

Send me a private message or email support@playcanvas.com