Hello,
I have a scene with 2d art and with 2d characters, but there is depth movement. (So similar to 2d demo.)
I usually have several NPC standing in the room and they mostly stand still and sometimes get teleported to different spots for cut-scenes.
I'm using polygon collider pathfinding.
Now the problem I have is that player can walk right through the NPC, even stand exactly where NPC is standing. So I was wondering if there is any built in function to prevent player from walking through NPC's and also to handle the Sorting map layers automatically?
Or do I have to create Nav mesh holes and use sorting map for NPC's ?
I built NPC using the wizard so they have the circle collider etc.
Thanks,
Comments
https://docs.unity3d.com/ScriptReference/TransparencySortMode.html
At runtime, you should see your NavMesh update automatically with "holes" around your NPCs when the Player moves. Try having your Scene window open beside the Game window - do they appear when the NavMesh is selected? The NPCs will indeed need Circle Colliders on their feet, but it sounds like that's all set up correctly.
And for sorting I should do it manually right?
When two characters are in the same Sorting Map area, the Z position of one of them should be automatically changed ever so slightly so that it's not in the same plane as the other, causing the correct display order.