Forum rules - please read before posting.

Issues with sorting map

Hey all,
I feel really bad bothering you all with another one of my questions after you all helped me out such a great deal, so I want to apologize beforehand.

I seem to run into a few issues with the sorting map. It works fine in 5 out of my 6 scenes, but in one of them the character doesn't follow the sorting map properly. It stays on the first layer I set up for the map (1), but until I go down to the very end of the NavMesh, it doesn't change its layer at all. But as soon as it reaches the bottom, it goes down to the final layer immediately (11).
Here are a few screenshots to illustrate what I'm experiencing.

image
image
image
image


Sidenote: I have read that a sorting map issue can be caused by the animator being placed on the sprite child instead of the root. But putting the animator on the root makes the speed of the character skyrocket and in all the other scenes the sorting map worked fine...I just don't get, what the issue is...please help!

Comments

  • When you had the Animator on the root, did the sorting map issue disappear at least?

    Does this issue only occur if you start from another scene, or when you begin in this scene as well?

    Any relevant messages in the Console?
  • No, the issue was still happening even when I added the animator to the root.

    The issue was first experienced when beginning in this scene, so yes, it occures as well when starting in this scene.

    I don't seem to get any relevant messages in the console except a message that Unity can't find my PlayerTalk animation since I didn't add this particular file yet. But I don't think it's relevant for this issue.
  • edited July 2016
    I'm having now another problem related to this in an another scene. It's not directly related to this problem but I guess kinda, so I'm gonna post it here.

    I had to place the "Follow SortingMap" script on the sprite child since placing it on the root didn't do anything. But, this script caused my character to go in scale to 1 - 1 - 1 (which is bad since I scaled my character to something around 10.xxx)
    So I added in the On Start Cutscene a "scale to" action and added on the root a "Moveable" script. That seemed to solve it in all the scenes when I did this in every scene. But in only one scene out of the 6 scenes I have the character goes in the Build ONLY back to scale 1 - 1 - 1 and it also ignores the rest of the "On Start" Cutscene.

    But only in scene 2. Not in the other scenes. In the In-Engine Player it scales fine though and it performs all the other actions I assigned to the cutscene...



    Plus, I'm having also some other Build-related issues...

    The WebGL Build is totally messed up, all sprites except the background are black boxes, the background is a blurry mess and playing the WebGL Build locally causes the system to abandon after Scene 1 claiming it doesn't have enough memory allocated.

    In the standalone Builds I don't have these issues.

    I don't know what to do anymore :/
  • Please post separate issues in separate threads in the future.

    The graphical WebGL issues are a problem with Unity - I would recommend updating to the latest patch release and not a beta, and then searching the Unity forums for help on the matter.

    The "memory allocated" issue could also be Unity-related, but it's hard to say without knowing the full error message.  What exactly is the error that Unity gives, and does it occur when leaving Scene 1 to go to a specific Scene, or have you tried entering a different Scene instead?

    The FollowSortingMap component should be placed on the sprite child.  For best practice, your characters should also have unit (1,1,1) scale - if the graphics are too small/large, you should insteed correct that by adjusting the Pixels Per Unit setting in the sprite Inspectors.

    Using the Object: Transform Action to change the player's scale is not recommended.  However, you may be able to circumvent the FollowSortingMap changing it back by removing line 294 in FollowSortingMap.cs.  Be sure to use the latest AC release first.  But again, you should set your character to unit scale if you can.

    As for the original issue, try placing the 2D Demo character, Brain2D (in /Assets/AdventureCreator/2D Demo/Resources) into the scene (disabling your own if already present) before runtime, and then run the scene.  Does the same issue occur with him?
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.