Forum rules - please read before posting.

Sorting map places some frames of my face animation behind the body

Hi!

I have been designing my game without animations so far and just recently started to try to sketch a few clips and make them work. I decided to start simple, so for the moment I am not using facing directions and I am focusing on achieving a simple talking animation.
So I have a character which is just a talking ball, and as a child I have the mouth with its talking animation clip (I mention this because I will be talking about body / mouth instead of body / head). Everything looks fine in the editor. Clips are properly named and selected by AC when there's dialogue during gameplay.
But then when the talking animation is triggered, some of my frames seem to disappear, I realized they don't actually disappear, but they are going BEHIND the face (even though the mouth is its child). (This was evident when I made the body (face) transparent, and I discovered the mouth behind it).
If I disable "also affect children" in the body's Follow Sorting Map component, all the mouth frames stay on top but then that becomes a problem when I need it to actually follow the sorting map (if I go behind a tree, the character will go behind it, but its mouth will float on top of eveything).
I have also tried modifying the mouth's order in the inspector, as well as the Z coordinate, but it didn't change anything.
Updated AC and tried a newer version of Unity that I had installed, and it's the same thing.
I am currently using AC 1.71.3 with Unity 2019.2.8f1
The demo character works fine, but I can't find a difference in the inspector nor the sprite editor of the individual "disappearing" frames.
The first time around I created the animations via changing a small mouth sprite, now I made sure to export all frames with the actual parent's size, so my keyframes now don't even have repositioning, it's literally just a sprite that it's supposed to change but instead flickers.
What could be making some frames go behind it and not others? I'm puzzled!

Well thank you in advance Chris and/or anyone who can help.

Comments

  • edited May 2020

    An update: I thought I found the solution and divided the animations in base and head (mouth) layers in the animator window, and I also made sure to have a weight of 1 in the head layer.
    I have the sorting map enabled and set to:
    -Follow default sorting map
    -Also affect children.

    This results in the following:

    -While in idle State, the mouth doesn't show.
    -while in talk state, not all mouth keyframes show.

    Of course, if I disable "also affect children" in the Follow Sorting Map script, all the animations work perfectly, but I still have the problem of the mouth staying on top of everything, so if I go behind a tree, it floats not unlike Cheshire cat's smile :D

  • If you pause the game when this happens, and examine the body and mouth sprites - what is the difference between them that would cause the mouth to be displayed behind the body? Is it's Z-position different, or is its Order In Layer not greater than that of the body?

    What properties do the talking animations affect? Just which sprite is assigned?

    If your camera is set to Perspective Projection, is there a difference if you switch to Orthographic?

    1. The weird thing is that during animation, nothing other than the mouth sprite changes, not its Order in Layer nor its Z-position. I paused and checked the inspector: no difference.
    2. The only property affected by the talking animation is the sprite assigned.
    3. The Camera was set to ortographic, but I went ahead and switched to Perspective, just to see if it made a difference. I also set the talking animation to play on Idle so I could test it while walking around the mesh and behind objects. The animation displays correctly, but an object in the scene is misplaced after an animation and more importantly: the sorting map doesn't really work, the whole character remains on top.

    Any ideas?

    I will try to recreate the player and animations from scratch in the mean time. I have the 2d character animation examples and they work correctly, as far as I can tell I'm doing everything like the examples. I'll tell you how it went.

  • Well after trial and error I managed to solve it. If anyone has this kind of "floating face" problem, first double check that all objects in the scene are in the order they are supposed to be, then check the values and placement of the sorting map, and I also found that in the 2d character example, the face was positioned at Z-0.01, so I repositioned mine accordingly, and now it's working!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.