Forum rules - please read before posting.

[SOLVED] Sorting map not affecting player

edited April 2014 in Technical Q&A
I'm having a problem with the sorting map in my game (1.30). I have a player character and an NPC in a scene, and everything set up like it should be:

- navmesh and floor collisioncube
- default playerstart
- sorting map with a start and end scale
- follow sorting map script on both player's and npc's sprite child

but when I run the scene only the NPC gets scaled. I can't seem to figure out why?

Comments

  • Was this working pre-1.30?  Nothing related to Sorting Maps was changed in the latest release.

    Does this problem occur when playing the game from this scene, are you using multiple Players, and is the Player prefab in the scene before the scene is run?
  • I don't think it was caused by 1.30, I upgraded another project and checked there and that seemed to be fine. It's more likely a setting gone awry, but I'm out of ideas where to look.

    I'm using only one player, and its prefab is not present in the scene before I run it. The problem occurs in two different scenes; in both of them the NPC reacts normally but the player does not respect the sorting map. Or, rather, I noticed the player's speed does get affected, but the scale doesn't. But both have the exact same sprite child setup with only a sprite renderer (same layer too), an animator and a follow sorting map script with the same settings.
  • How confusing.  Would you mind swapping them around?  Just disable their Player/NPC scripts and add on the opposite (in a backup project), and set the old NPC to be the Player.  This isn't enough for me to be able to re-create, so I need to know if it's down to the Player's prefab, or the scene itself.
  • That was a good suggestion, and I was hoping it would yield a result, but I just did the role-swapping and now neither of them seem to care about the sorting map at all, even after I switched them back to normal. They're standing within the sorting map area, they can walk across the navmesh and they are both affected by the scale speed setting, but they ignore the scale size setting completely. I don't understand what is going on, ha.

    I can send you my project if that helps troubleshooting?
  • edited April 2014
    OK - but please try to send only the minimum number of assets to re-create the issue, if you can.
  • Update: thanks to Chris the issue was solved by moving the Animator component off of the sprite child and onto the root object and adjusting the animations to use sprite frames instead of hard scale transforms.
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.