Forum rules - please read before posting.

Animating with position doesn't work on sorting areas

edited September 2022 in Technical Q&A

I have an animation position property for my player character that lets her bob up and down when walking. This method suits me since she's wearing garments as child objects, so making the vertical movement a part of her original animation loop wouldn't work (the garments would stay still while she moves up and down).

However, whenever she's walking on a sorting area, on a sorting map, the position part of the animation doesn't play, and she instead moves with no vertical movement whatsoever.

Any way to keep the position property intact even with the sorting areas in effect?

Comments

  • What are your AC/Unity versions, and can you share some screenshots/video? This is a visual issue, so it'll make things more clear to see it directly.

    The Follow Sorting Map will adjust its object's position along the Z-axis. Which object is it attached to, and are you animating the position of the same object?

    The Y-position should be preserved by this process, but if you keep the two objects separate there shouldn't be any conflict at all. If necessary, you could move the sprite/animation to a child of your sprite child, so that the two are independent.

  • I use AC 1.74.2 and Unity 2020.3

    I used the character wizard, so the Follow Sorting Map is attached to the sprite child, as is the animation.

    If I uncheck the Follow Sorting Map, the character will move up and down correctly as it walks around. When checked, there's no such movement (only the animation loop). But doing this prevents me from setting a correct size for the player character in different scenes, obviously.

    I don't quite understand your advice: "If necessary, you could move the sprite/animation to a child of your sprite child, so that the two are independent."
    This sound a bit paradoxal. Surely, both the animation and the sorting map component must be a part of the sprite child itself?

  • edited September 2022

    Surely, both the animation and the sorting map component must be a part of the sprite child itself?

    The graphics/animation don't necessarily need to be an immediate child of the root. They can be themselves children of the "Sprite child" assigned in the character's root.

    Try a Hierarchy of the form:

    • Character
      • Sprite child (with Follow Sorting Map)
        • Animator
  • edited September 2022

    Ok, so I followed your instructions, and it did indeed solve the conflict with the animator and the follow sorting map, but now the game doesn't seem to find the character's loops, because it's just constantly walking (instead of playing idle and talk)
    PS:
    The console isn't giving me any error messages

  • Ok, solved it, didn't see that I needed to specify where the Animator was located ("if not on sprite child")
    All good now!

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.