I managed to figure it out - with F2, you can actually edit the paths to the rigs manually, so I just copied the animation, renamed the copies, and then set the correct path to the involved rigs.
I think I set everything as it should be. I have the movement set to 8 directions. The rig objects for other directions are always turned off at the beginning of any directional animation, but I have unwanted rigs of the offed animations appearing during character movement. It is always the rig of the next closest direction.
So, for example, when walking to the right, I get an animation for 90°, and depending on if it is more up-right or down-right, the rig of 45° or 135° appears.
I assume the setting of the animation controller causes the problem, but I don’t know where the mistake is. Could you please advise?
The unwanted rigs set to turn off during animation.
Blend Trees can give unexpected results when they involve the enabling/disabling of objects - as you're not dealing with a property that can be properly blended.
You should be able to get around this by enabling Angle snapping in the character's Inspector, however.
The other approach to this problem is to animate the rig enabled states separately to the character animations themselves. That is, have a separate layer that uses regular transitions to set the enabled rig, and then have a single "walk" etc animation that animates all rigs together in a walkcycle, which can then be put in a BlendTree with Idle, Run etc.
Hey Dev_martas, I just saw my thread popping up so I thought I can give my two cents. Not sure if useful, but I also ended up using bled trees in an "hacky" way. I prevented the actual blending by doing this: https://imgur.com/2zBWOYo
(sorry I can't seem to be able to include images)
This way there's no overlapping of states, so the blend tree behaves more like a normal animator state manager.
To animate the rigs I created different layers to the animator, one of which is in charge exclusively of swapping the rig depending on the direction the character is facing.
all the body_X objects are the rigs facing different directions
edit: note that in my case I have 6 directions and the angles are customized to my need (I wanted narrower angles for left/right and larger for the diagonals), so in your case the angles would be different.
Zombiehype, thanks a lot! :-) I was actually also wondering how to set the blending tree if I have unequal movement angles, so this settled all these issues and now it seems to work great!
ChrisIceBox, thank you for the advice. In the end, I created the angle "intervals" in the blending tree for the rig changing based on Zombiehype's advice.
Would you recommend switching to regular transitions instead or is the above solution equally good? It seems to work nicely.
@Zombiehype May I ask how you animate picking up/interacting with items in the scene? For example, how do you align the animation with the scene item (if the animation contains the item)?
Do you have rigs specifically designated for item interaction? I noticed in one of your screenshots you have an Items object in the GuyAnimator parent.
sure. I have 3 animations for picking up objects: one for picking up from the floor, one from medium height, one from above the character's head. depending on where the item is in the scene I use one of those. each animation is declined in all 6 directions, except for the "high" one which I needed only for the UL and UR directions (so when the character is facing away from the camera).
the animations are actually only "half" movement: for example in the pick up animation, the character goes from standing to bending over with the arm outstretched towards the floor, and then stops. in the animator I have duplicated the same animation but given it a speed of "-1" and a different name. This way in an action list I can call the "forward" animation where the character reaches for the item, then remove the item from the scene, and then call the "reverse" animation so the character goes back to standing. I created an asset action list that handles all that with parameters (I pass which animation to play, what hotspot to remove and what inventory item to add)
this is what my "gestures" animator layer looks like (basically containing all the body animations not related to movement like walking or running). I circled the 3 sets of "pick up" animations
In all animations of this type the item just disappears after being picked up, so the animation doesn't normally contain the item. the "items" object you saw in the character rig is actually containing items I need the character to hold in his hands during some special cutscenes, so not related to the "normal" routine of picking up items from the scene. I'm not super fond of having all those sprites pre-loaded in the character, so over time I actually developed other ways to attach sprites to the character's hands which I think are cleaner, so I'll prolly remove that "items" object sooner or later anyway
Comments
Not that I'm aware of - though Unity's own discussion pages may have a more definitive answer.
I managed to figure it out - with F2, you can actually edit the paths to the rigs manually, so I just copied the animation, renamed the copies, and then set the correct path to the involved rigs.
I think I set everything as it should be. I have the movement set to 8 directions. The rig objects for other directions are always turned off at the beginning of any directional animation, but I have unwanted rigs of the offed animations appearing during character movement. It is always the rig of the next closest direction.
So, for example, when walking to the right, I get an animation for 90°, and depending on if it is more up-right or down-right, the rig of 45° or 135° appears.
I assume the setting of the animation controller causes the problem, but I don’t know where the mistake is. Could you please advise?
The unwanted rigs set to turn off during animation.

The hierarchy of the Player prefab.

The blend tree for walking setting.

Blend Trees can give unexpected results when they involve the enabling/disabling of objects - as you're not dealing with a property that can be properly blended.
You should be able to get around this by enabling Angle snapping in the character's Inspector, however.
The other approach to this problem is to animate the rig enabled states separately to the character animations themselves. That is, have a separate layer that uses regular transitions to set the enabled rig, and then have a single "walk" etc animation that animates all rigs together in a walkcycle, which can then be put in a BlendTree with Idle, Run etc.
Hey Dev_martas, I just saw my thread popping up so I thought I can give my two cents. Not sure if useful, but I also ended up using bled trees in an "hacky" way. I prevented the actual blending by doing this: https://imgur.com/2zBWOYo
(sorry I can't seem to be able to include images)
This way there's no overlapping of states, so the blend tree behaves more like a normal animator state manager.
To animate the rigs I created different layers to the animator, one of which is in charge exclusively of swapping the rig depending on the direction the character is facing.
the layer: https://imgur.com/pq6FF7N
inside "turn": https://imgur.com/oDzFmNp
each of the animations turn_X is a simple switch on/off of the rigs (all off except the one needed)
for reference, my character structure looks like this: https://imgur.com/brWKS6q
all the body_X objects are the rigs facing different directions
edit: note that in my case I have 6 directions and the angles are customized to my need (I wanted narrower angles for left/right and larger for the diagonals), so in your case the angles would be different.
Zombiehype, thanks a lot! :-) I was actually also wondering how to set the blending tree if I have unequal movement angles, so this settled all these issues and now it seems to work great!
ChrisIceBox, thank you for the advice. In the end, I created the angle "intervals" in the blending tree for the rig changing based on Zombiehype's advice.
Would you recommend switching to regular transitions instead or is the above solution equally good? It seems to work nicely.
If it works, it works!
@Zombiehype May I ask how you animate picking up/interacting with items in the scene? For example, how do you align the animation with the scene item (if the animation contains the item)?
Do you have rigs specifically designated for item interaction? I noticed in one of your screenshots you have an Items object in the GuyAnimator parent.
sure. I have 3 animations for picking up objects: one for picking up from the floor, one from medium height, one from above the character's head. depending on where the item is in the scene I use one of those. each animation is declined in all 6 directions, except for the "high" one which I needed only for the UL and UR directions (so when the character is facing away from the camera).
the animations are actually only "half" movement: for example in the pick up animation, the character goes from standing to bending over with the arm outstretched towards the floor, and then stops. in the animator I have duplicated the same animation but given it a speed of "-1" and a different name. This way in an action list I can call the "forward" animation where the character reaches for the item, then remove the item from the scene, and then call the "reverse" animation so the character goes back to standing. I created an asset action list that handles all that with parameters (I pass which animation to play, what hotspot to remove and what inventory item to add)
this is what my "gestures" animator layer looks like (basically containing all the body animations not related to movement like walking or running). I circled the 3 sets of "pick up" animations
In all animations of this type the item just disappears after being picked up, so the animation doesn't normally contain the item. the "items" object you saw in the character rig is actually containing items I need the character to hold in his hands during some special cutscenes, so not related to the "normal" routine of picking up items from the scene. I'm not super fond of having all those sprites pre-loaded in the character, so over time I actually developed other ways to attach sprites to the character's hands which I think are cleaner, so I'll prolly remove that "items" object sooner or later anyway
hope it helps!