Hi there, I'm having a really confusing problem regarding sorting maps and scene switching:
If I start the game in scene A, the player can move in front of and behind an NPC and everything is rendered correctly. But if I switch to Scene B (using a Scene Switch action) and then switch back again to Scene A, whenever the player stands behind the NPC he will be displayed above the NPC. The player standing in front of the NPC still works as expected though...
Both the player and the NPC have the "Remember NPC" and "Remember Transform" components, and both their sprite childs have the following set to their "Follow sorting map" component:
Follow default Sorting: checked
Offset original Order: checked
Also affect children: checked
The sorting map is set to affect sprites: "Order In Layer"
Using version 1.64.5
Comments
I know how hard it is to reproduce bugs so here's a minimal repro that illustrates the problem clearly:
<REMOVED BY ADMIN>
Instructions:
1. Play Scene1 (located in the Assets/Korath/Scenes) and notice that the NPC (that was teleported there in the OnStart cutscene) renders fine in relation to the player
2. Go through the door (switches to Scene2)
3. Go back trough the door (switches back to Scene1) and notice that the player is now rendered on top of the NPC (although standing behind him)
Clue:
Locate the “EnterFromScene2” Player Start in Scene1 and change the “Previous Scene” from “Scene2” to “” – the NPC will now be rendered correctly…
And apologies for exposing your source - won't happen again (and I deleted the download).
A quick bonus question since you did manage to look at the repro: Could you also tell me why my characters are all facing up rather than down by default?