Animation layers using masks seem to break

Hi everyone!

I’m trying to set up a simple character that has a running animation + an attack animation.
Ideally, the character should be able to perform an attack while running, so I created two Anim layers: one handles the running-idle parts and the other one handles the attack.
So far so good, animations blend correctly.

Now I want the walking animations to only move the lower body and the attack animations to only move the upper body, so I added the masks to each layer and apparently that breaks them. If I add a mask to the attack layer only, attacks don’t work at all. If I add masks to both layers, all the animations stop working completely.

I made an example project showing the exact model + animations I’m using here.

Not sure if this is relevant, but I’m getting these errors when modifying the layers in the editor:

TypeError: Cannot read properties of undefined (reading ‘name’)
at editor.js:79536
at Array.forEach ()
at AnimstategraphState._loadTransitions (editor.js:79532)
at Observer. (editor.js:79631)
at Observer.Events.emit (observer.js:107)
at Observer._prepare (observer.js:405)
at Observer.set (observer.js:627)
at Observer.set (observer.js:609)
at AnimstategraphView._onAddEdge (editor.js:78444)
at HTMLDivElement. (pcui-graph.js:44778)
at HTMLDivElement.sentryWrapped (bundle.min.js:2)
at Graph._dispatchEvent (pcui-graph.js:44783)
at Graph._onEdgeConnected (pcui-graph.js:44411)
at child.cellPointerDownEvent (pcui-graph.js:43137)
at triggerEvents (pcui-graph.js:21592)
at triggerApi (pcui-graph.js:21552)
at eventsApi (pcui-graph.js:21336)
at child.Events.trigger (pcui-graph.js:21542)
at child.notify (pcui-graph.js:32166)
at child.pointerdown (pcui-graph.js:32663)
at child.notifyPointerdown (pcui-graph.js:33017)
at child.pointerdown (pcui-graph.js:33035)
at child.pointerdown (pcui-graph.js:36892)
at HTMLDivElement.dispatch (pcui-graph.js:4741)
at HTMLDivElement.elemData.handle (pcui-graph.js:4561)
at HTMLDivElement.sentryWrapped (bundle.min.js:2)

looping @Elliott

1 Like

Did you find any solution for this? Having the exact same problem.

It looks as though this was caused by a bug that was present in the anim component last year. Deleting and recreating the anim component in this instance resolves the issue in my tests.

@eivind if this doesn’t resolve your issue, please could you provide a project with the issue reproduced?

Hm, okay. It seems that creating a layer mask, even if I include all bones in the mask, makes the layer with the mask not playing at all.

You can take a look at this project: https://playcanvas.com/project/878059 @Elliott.

Thanks!

Hi @eivind ,

Thanks for sharing the project. I’m currently debugging the asset you provided to see if this is a runtime issue or a data issue. I’ll report back soon!