[SOLVED] Adding an Anim Layer Mask prevents animations from playing

I have a basic walk cycle animation and I’m trying to apply a mask so that the character’s arms are not affected by the walk cycle. Every time I apply a mask, the animation no longer plays. I’ve recreated this issue in a fresh project with a single animation on a single layer. As soon as I delete the mask and refresh, the animation plays again. No console errors are present in the editor or the launch tab.

In the Anim Layer Masking page of the user manual it says:

Any bones which are not selected in this mask will not be driven by any of the animations which play in this mask’s layer.

To my understanding, if I deselect both arm hierarchies in the mask, the walk cycle should still play, the torso would still be affected by the walk cycle, but everything from the shoulders down shouldn’t be moving on their own.

Here is what my mask hierarchy looks like:


However, it doesn’t seem to matter which nodes in the Armature are selected/unselected. Any time there is any mask on the layer, the animation no longer plays.

Here is how the anim component is set up:

And the state graph is pretty much using the default settings:

I’m basically trying to recreate what is shown in this demo video from the PlayCanvas blog.

For reference, this is what the walk cycle looks like:
chrome-capture (2)

Any suggestions or tips would be appreciated!

Like this?

Note that you can easily disable the whole arms’ by disabling shoulder.L & shoulder.R and their children.
Not sure why enabling masking would disable your whole animation.
It works fine for me - I didn’t change any of the Anim component settings.
But then again I did recreate the Anim component.
Perhaps you should too.

image

My fork of your project:
https://playcanvas.com/project/881779/overview/fork-forum-character

By the way, I’d suggest you not add duplicate project links when you create initial thread post.
It’s confusing ^^

1 Like

Looks like the issue was with setting the Root Bone incorrectly and therefore the paths to the nodes didn’t match up

On the Anim Component, it was set to be the Armature

However, if we look at the animation asset in the PlayCanvas Viewer

We can see that the root bone is one parent above Armature
image

So we can either leave Root Bone empty (in which case it uses the current entity as the Root Bone) or explicitly set it to the Player Entity

Now we can set the mask to not animate the arms for example

Now we have someone who can’t move their arms
Kapture 2022-02-12 at 00.06.41

Example fork project: https://playcanvas.com/editor/scene/1334430

@RPaladin method of removing and adding the Anim Component again worked because by doing so, it removed the previous Root Bone assignment and was empty, therefore it was using the Player entity as the Root Bone

3 Likes

@RPaladin @yaustar Thank you both very much! I had been setting the root bone incorrectly across all my anim components in multiple projects. :man_facepalming: The animations worked fine, up until masking. Hopefully this post can help someone else find their way.

Big thanks to the PlayCanvas team for adding anim layers, I’m really starting to appreciate just how powerful of a tool they are!

3 Likes