Forum rules - please read before posting.

2D game sorting order problems, NPC disappearing if in the same sorting order as player

To start, I've been a 3D guy all my life and this is the first time I'm doing a 2D game and want to rant a little bit. 2D is is so much harder. I had so many issues especially with sorting order and now I'm a bit confused because I have no other clue what is causing this.
So I finally manage to have my player move around a top down view scene with the right sorting order, it was a pain to get it right but I did....now I want NPCs the player can interact to, and I think because of sorting order the NPC disappear if the player is in the same sorting order as the NPC. and somehow the player disappear if he goes in the sorting order that is above the sorting order that the NPC is in.
So I have 6 sorting orders in the scene, the NPC is in the 5th one...if the player goes inside the 5th sorting order, the NPC disappears, if the player goes inside the 4th one, the player disappear. the other sorting orders are fine. And if I put in more NPCs, they all just disappear as I go from sorting order to another sorting order.
Anyone has this issue?

Comments

  • edited September 2020

    I found the solution, just delete the follow sorting order on the NPCs.

  • In order to correctly display two characters that are in the same sorting region, AC will offset their relative positions along the Z-axis (i.e. towards/away from the camera).

    What you're likely seeing is that one of the characters is disappearing behind your background graphics, which may occur if it's the same distance from the camera.

    Try moving your background in the Z-axis a tiny bit - it shouldn't affect its display if you use an Orthographic camera, but should prevent issue when two characters are in the same region.

  • edited September 2020

    Hi Chris....it didn't work for me even when I move the background back in the Z axis, whether it's in ortho or perspective. But thankfully there is no plan on having more than 1 moving character, so it should be ok.
    I'll try to figure this out a bit later when I have the time but thanks for the solution, appreciate it.

  • One other thing to check, FWIW: if your background is always intended to appear beneath characters, you can set its sprite's "Order In Layer" value to something very negative, e.g. -100.

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.