Forum rules - please read before posting.

Issue or conflict with layers

Hello there, I was wondering if somebody could offer some advice or tips.

I have just created a rough game to flex my muscles of AC ( Yey!! ) I have a niggling bug at the end of the game where an NPC moves outside of the sorting map - if used.

Another issue is if I take the sorting map off , the player blinks in and out through the sprite of the NPC. ( If that makes sense? looks like it can't work out what layer to go on. )

So to further explain.

1 ) When the sorting may is removed from the NPC. The position of the NPC stays the same... but the ordering layer stops working correctly and flashes in and out of the same layer as the player. It should also be noted that if I use the regular order layer and set the player to 100 and the NPC to 1. This still hasn't resolved.

2 ) If the sorting map is added or enabled. The the NPC moves outside of the scene altogether.

A strange bug, I can't quite wrap around. Any suggestions as to what I have done that may cause a conflict? Is it something in my control to change?

This is under the **Component - #Follow Sorting Map **

Thank you for your help!

Comments

  • What are your AC and Unity versions?

    If your scene has no Sorting Map, then how your sprite are rendered relative to one another will be based on your Unity setting (or custom scripts) - AC won't be affecting their order values any more.

    When you say the NPC moves outside of the scene, where exactly is he going? Try selecting him in the Hierarchy and locating him in the Scene window - share screenshots if you can, as this sounds like a visual problem.

    The Sorting Map can be used to keep two characters within the same "sorting area" rendered in the correct order - however, it's not strictly necessary with recent versions of Unity. Instead, you can use Unity's Graphic settings to set your Transparency Sort Axis to (0,1,0) - i.e. the y-axis - so that Unity handles this sorting for you. A Sorting Map can still be used for character scaling - just uncheck Affect characters sorting? in its Inspector to prevent it adjusting sort order values.

  • Good question. It is something I would need to check. I think they are of the more recent versions but not necessarily the most recent.

    Ah the scene has a sorting map. We would literally transport off of the sorting map and of the view of the camera. Just a nose would be visible.

    Quite strange, more of a niggle for my homework really but still something that would bug me in the future. Thanks.

  • View the character in the Scene window, rather than just the Game window. Check their Z-position as well in their Inspector, it may help clue us into what's going on.

    I'd recommend relying on Unity's own sorting options instead as above, however. The Sorting Map can still be used, but only for scaling them up and down to give the appearance of depth.

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.