Hi everyone,
I updated from (I guess) 1.64 to 1.67.2 and now have a problem with my SortingMaps.
I'm making a 2D-Game and have several scenes where I change the players SortingMap via the Character -> Change Rendering Action.
Until I updated, this worked without any problems, but now it seems the SortingMap isn't changed at runtime anymore.
If I call an ActionList and change the SortingMap nothing happens in the first place, but only after I stop the game the SortingMap in the Players FollowSortingMap script is changed.
You can see this behaviour in the embedded GIF.
The Hotspot I'm clicking is only changing the SortingMap and nothing else.
Any ideas why this happens and how I could fix this? In the changelogs i didn't find anything referring to SortingMaps.
Thanks!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Short update on this topic:
I reverted back to 1.64.1 where the problem didn't happen. I thought maybe I did something wrong on the update.
After updating to 1.67.2 again, the described behaviour occurs again.
I also discovered that a SortingMap change (via Character -> Change Rendering) works directly after implementing it (e.g. I create a new Hotspot with the action and it works), but after reloading the scene the action does not work anymore and the SortingMap is not changing.
Any ideas?
The error occurs on Unity 2018.2.1f1 & 2018.3.11f1
I'm afraid your GIF is too small to really see what's going on.
If you are relying on a persistent Player prefab, then this is likely related to a bugfix that involved player data becoming restored upon a natural scene change.
If you wish to save changes made to a Player that are specific to a scene, you should rely on a local instance of that Player by dropping his prefab in to the scene file itself before runtime. Otherwise, you may have to look into recording the change with a Local variable, and using that to re-apply the effect in your OnStart cutscene.
Hi Chris,
thanks for your answer.
I'll try to describe it better, what I said about reloading may have been misleading.
Either way it happens with a "in-scene-player" and also with a persistent Player prefab.
I also seems to make no difference if I enable or disable player switching in the settings manager.
My Sorting Maps have Constant IDs.
I am really not sure why, but the behaviour which occurs to me now is not the same as described before, but maybe even weirder:
I reverted my project (using git) back to AC 1.64.1 and Unity 2018.2.1f1, everything worked.
I also tried Unity 2018.3.11f1 with AC 1.64.1. everything worked fine.
So updated AC today again. This time to 1.67.3.
My Player is on the Default Sorting Map and the FSM component on his Sprite Child looks like this:
A simple action like this:
Actually does nothing at the moment. No visible change at all. The FSM component does nothing.
(I was on a point earlier, when I typed my first post, where I would press Stop in the unity editor and afterwards the FSM component changed to the chosen Sorting Map, but this doesn't happen anymore.)
Now to the really weird part, which I just realized today for the first time:
If I have the ActionList Editor open and the action (from the second screenshot) visible on my Screen, while running the game and clicking on the Hotspot, it works. The chosen SortingMap changes in the moment i click on it. But if I close the ActionList Editor, it doesn't anymore.
Even weirder: I have a bigger ActionList and animations, where my player takes an elevator to another "platform" and he changes the SortingMap while this animation is playing (working on AC 1.64.1).
If I have the ActionList editor open like this:
it is working.
BUT if i scroll a bit to the left or right, so that the Character -> Change Rendering Action is not visible anymore, like this:
it stops working immediatly and the SortingMap isn't changed.
I made another gif (hopefully this time big enough), where you see the described behaviour, working at first, then restarting, scrolling the action out of the screen and then not working anymore:
Alternative link to gif.
I also tried deleting the AC Update files from unity, after reverting my project and redownloading it, just in case something corrupted on the download, but it did not change anything.
Very odd indeed. Thank you for the details - I will attempt a recreation and will let you know if I need more information.
Ok, thanks.
I reverted again to 1.64.1 so I can continue working.
Is there a way for me to active the vertical movement factor in Retro-style movement-mode? This was one of the main reasons for me to update AC in first place.
This should be fixed now in v1.67.4.
Works like charm.
Thanks for the great support!