I have one template which has an anim component with a single layer and a mask. If I instantiate a new entity from this template like so:
let template = this.app.assets.find('Player'); let player = template.resource.instantiate(); this.app.root.addChild(player);
The mask will not be present on the newly instantiated entity. All the animations & state graph etc work fine, just not the mask. I can place the same entity in the scene using the editor and the mask works fine.
In this example, I’m using a mask that disables the bones on the left side of the character’s body. The character on the left was placed manually using the editor and the one on the right was instantiated from the template. As we can see, the mask applies to the left one but not the right. It’s unclear if this is intended behaviour or a bug with anim layer masks when combined with the use of templates.
I can still assign masks using the AnimComponentLayer
assignMask() method which works fine.
Here is an example project.