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:
Any suggestions or tips would be appreciated!
Note that you can easily disable the whole arms’ by disabling
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.
My fork of your project:
By the way, I’d suggest you not add duplicate project links when you create initial thread post.
It’s confusing ^^
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
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
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
@RPaladin @yaustar Thank you both very much! I had been setting the root bone incorrectly across all my anim components in multiple projects. 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!