Hello, this is regarding my Patch 1.82.2 post.
The warnings start to list after the latest update. Before the update, these warnings were absent.
I have fixed the ones about the inputs.
But the ones about the character animations persist. My character has three layers that become visible/invisible depending on which way she looks. When she turns backwards, the layer that turns to the camera becomes invisible. And then the warnings start to be listed. Maybe because the character's certain layer is invisible, its animations cannot be played.
However, the character's rotation settings (in my project, "eight directions" is selected) are, of course, not set in individual layers but by the root layer.
How can I solve this issue?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Can you share shots of the character's root Inspector, and their Animator's Base layer?
If your character's Animation engine is set to Sprites Unity, then the expected animations (listed if you click List expected animations?), will need to be present in the Base layer. If you switch to Sprites Unity Complex, then animations are driven using Animator parameters, which does support sub-layers.
It became a little too complicated. The player character prefab has child objects of different sprites and different animations. By "layers" I meant them.
But since the root player has only one selection of animation controller, and the 3 child objects shift visible/invisible, I think when they become invisible, that's when I get the warnings for not playing the animation.
Up to ver 1.82.1, it worked flawlessly, without errors. But after 1.82.2 (and 1.82.3), things didn't go well no matter what I tried.
So I reverted back to 1.82.1, and am planning to do no more AC updates for my project just for the sake of the player anims.
The warnings appearance is based purely on the presence of the states within the Animator - the state of the GameObject children that they in turn affect should have no bearing.
I'm sure this can be sorted out, but I would need to see the images / details mentioned above to know the situation in enough detail.
Okay, below are the screenshots:
https://imgur.com/a/0AFkY2o
Below is the code in my player character's script, attached as a component. It makes the child sprites visible or invisible:
Your images are cropped - is the Animator on the sprite-child, and is the Animator showing the base layer?
Do the "Cannot play animations" warnings go away if you disable your custom script?
Your script disables the sprite child, which will prevent animations from playing. Your Animator will need to be on a shared parent for it to be able to affect the sprites on your separate Front/Back/Right objects, and the sprite child should always be kept enabled.
Create a new Empty child GameObject, make it a child of the root, set it as the sprite child, and move your Animator there. If you then update your animations to have them reference the child GameObjects, you can also embed their enabled states within the animations - no need for a custom script.
Yes, the animator is showing the base layer only. There is (was until now) only one layer in each animator.
My problem is that I couldn't find a way to use multiple sprites (My 2D player character from the front/back) in a single animator.
Here is how it looks now:
https://imgur.com/a/HgwLN8J
I found a work around. Instead of toggling the PSBs visible/invisible, I made their scales switch between the world size/ zero. Now the warnings are gone.